devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/5] Align and document return values of phandle and reference parsing for OF and ACPI
@ 2017-09-14 12:29 Sakari Ailus
  2017-09-14 12:29 ` [RFC 2/5] of: Return -ENODATA on accessing out of bounds indices in phandle parsing Sakari Ailus
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sakari Ailus @ 2017-09-14 12:29 UTC (permalink / raw)
  To: devicetree, linux-acpi; +Cc: rafael, robh, mika.westerberg, frowand.list

Hi everyone,

I recently came across a difference in behaviour of OF phandle parsing and
ACPI reference parsing, both of which can soon be accessed using
fwnode_property_get_reference_args.

The main change in this proposal touches OF, and specifically the change
is about using -ENODATA to tell that the phandle reference list entry that
was accessed does not exist. -ENOENT was used previously, but the same
error code was also used to tell that a phandle was empty, making it
impossible for the caller to figure out which of the two was the case.

I'm sending the set as RFC. In my limited testing I have found no ill
effects.

These patches are on top of linux-next.

Comments on the approach and the changes themselves would be most welcome.

For what it's worth, fwnode_property_get_reference_args is in Rafael's
tree (as well as in linux-next) and hasn't reached mainline yet. It will
be used in the near future for parsing references to external devices in
the V4L2 framework.

These patches can be found here:

<URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=fwnode-parse>

Regards,

- Sakari

Sakari Ailus (5):
  clk: Increment assigned-clocks index for empty phandles
  of: Return -ENODATA on accessing out of bounds indices in phandle
    parsing
  of: Return total number of entries in of_count_phandle_with_args
  ACPI: align acpi_fwnode_get_reference_args with OF counterpart
  device property: Document fwnode_property_get_reference_args better

 drivers/acpi/property.c              |  3 +++
 drivers/base/power/domain.c          |  2 +-
 drivers/base/property.c              |  5 +++++
 drivers/clk/clk-conf.c               |  8 +++++---
 drivers/clk/clkdev.c                 |  2 +-
 drivers/gpio/gpiolib-of.c            |  2 +-
 drivers/gpio/gpiolib.c               |  2 +-
 drivers/gpu/host1x/mipi.c            |  2 +-
 drivers/hwspinlock/hwspinlock_core.c |  2 +-
 drivers/iio/inkern.c                 |  2 +-
 drivers/of/base.c                    | 37 ++++++++++++++++++++++++------------
 drivers/pwm/core.c                   |  2 +-
 drivers/regulator/gpio-regulator.c   |  2 +-
 drivers/reset/core.c                 |  3 ++-
 drivers/spi/spi.c                    |  2 +-
 15 files changed, 50 insertions(+), 26 deletions(-)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-09-26  9:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-14 12:29 [RFC 0/5] Align and document return values of phandle and reference parsing for OF and ACPI Sakari Ailus
2017-09-14 12:29 ` [RFC 2/5] of: Return -ENODATA on accessing out of bounds indices in phandle parsing Sakari Ailus
2017-09-14 12:29 ` [RFC 3/5] of: Return total number of entries in of_count_phandle_with_args Sakari Ailus
     [not found] ` <20170914122914.14122-1-sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-09-14 12:29   ` [RFC 1/5] clk: Increment assigned-clocks index for empty phandles Sakari Ailus
2017-09-14 12:29   ` [RFC 4/5] ACPI: align acpi_fwnode_get_reference_args with OF counterpart Sakari Ailus
2017-09-14 12:29   ` [RFC 5/5] device property: Document fwnode_property_get_reference_args better Sakari Ailus
2017-09-15 19:57 ` [RFC 0/5] Align and document return values of phandle and reference parsing for OF and ACPI Rob Herring
2017-09-19 23:01   ` Sakari Ailus
2017-09-26  9:02     ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).