@@ -48,7 +48,19 @@ struct resource iomem_resource = {
48
48
};
49
49
EXPORT_SYMBOL (iomem_resource );
50
50
51
- /* constraints to be met while allocating resources */
51
+ /**
52
+ * struct resource_constraint - constraints to be met while searching empty
53
+ * resource space
54
+ * @min: The minimum address for the memory range
55
+ * @max: The maximum address for the memory range
56
+ * @align: Alignment for the start address of the empty space
57
+ * @alignf: Additional alignment constraints callback
58
+ * @alignf_data: Data provided for @alignf callback
59
+ *
60
+ * Contains the range and alignment constraints that have to be met during
61
+ * find_resource_space(). @alignf can be NULL indicating no alignment beyond
62
+ * @align is necessary.
63
+ */
52
64
struct resource_constraint {
53
65
resource_size_t min , max , align ;
54
66
resource_size_t (* alignf )(void * , const struct resource * ,
@@ -686,8 +698,19 @@ next: if (!this || this->end == root->end)
686
698
return - EBUSY ;
687
699
}
688
700
689
- /*
690
- * Find empty space in the resource tree given range and alignment.
701
+ /**
702
+ * find_resource_space - Find empty space in the resource tree
703
+ * @root: Root resource descriptor
704
+ * @new: Resource descriptor awaiting an empty resource space
705
+ * @size: The minimum size of the empty space
706
+ * @constraint: The range and alignment constraints to be met
707
+ *
708
+ * Finds an empty space under @root in the resource tree satisfying range and
709
+ * alignment @constraints.
710
+ *
711
+ * Return:
712
+ * * %0 - if successful, @new members start, end, and flags are altered.
713
+ * * %-EBUSY - if no empty space was found.
691
714
*/
692
715
static int find_resource_space (struct resource * root , struct resource * new ,
693
716
resource_size_t size ,
0 commit comments