aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/platform.c
diff options
context:
space:
mode:
authorRichard Fitzgerald <rf@opensource.wolfsonmicro.com>2016-09-12 14:01:29 +0100
committerRob Herring <robh@kernel.org>2016-09-15 08:33:01 -0500
commita67e9472da423ec47a3586920b526ebaedf25fc3 (patch)
tree0e6b3da989b014b7eece1b4222f189de76c43bae /drivers/of/platform.c
parentof: Make of_find_property_value_of_size take a length range (diff)
downloadlinux-dev-a67e9472da423ec47a3586920b526ebaedf25fc3.tar.xz
linux-dev-a67e9472da423ec47a3586920b526ebaedf25fc3.zip
of: Add array read functions with min/max size limits
Add a new set of array reading functions that take a minimum and maximum size limit and will fail if the property size is not within the size limits. This makes it more convenient for drivers that use variable-size DT arrays which must be bounded at both ends - data must be at least N entries but must not overflow the array it is being copied into. It is also more efficient than making this functionality out of existing public functions and avoids duplication. The existing array functions have been left in the API, since there are a very large number of clients of those functions and their existing functionality is still useful. This avoids turning a small API improvement into a major kernel rework. The old functions have been turned into mininmal static inlines calling the new functions. The old functions had no upper limit on the actual size of the dts entry, to preserve this functionality rather than keeping two near-identical implementations, if the new function is called with max=0 there is no limit on the size of the dts entry but only the min number of elements are read. Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/platform.c')
0 files changed, 0 insertions, 0 deletions