devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: devicetree@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: rafael@kernel.org, robh@kernel.org,
	mika.westerberg@linux.intel.com, frowand.list@gmail.com
Subject: [RFC 0/5] Align and document return values of phandle and reference parsing for OF and ACPI
Date: Thu, 14 Sep 2017 15:29:09 +0300	[thread overview]
Message-ID: <20170914122914.14122-1-sakari.ailus@linux.intel.com> (raw)

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


             reply	other threads:[~2017-09-14 12:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 12:29 Sakari Ailus [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170914122914.14122-1-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).