devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Rob Herring <rob.herring@calxeda.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org,
	Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 1/2] of: return -ENOENT when no property
Date: Fri, 29 Jun 2012 13:57:58 +0900	[thread overview]
Message-ID: <1340945879-11712-2-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1340945879-11712-1-git-send-email-acourbot@nvidia.com>

Make of_parse_phandle_with_args return -ENOENT instead of -EINVAL when
no matching property is found, which allows to discriminate between
absence of property and parsing error.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 drivers/of/base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 7acd785..93165b7a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -902,7 +902,7 @@ int of_parse_phandle_with_args(struct device_node *np, const char *list_name,
 	/* Retrieve the phandle list property */
 	list = of_get_property(np, list_name, &size);
 	if (!list)
-		return -EINVAL;
+		return -ENOENT;
 	list_end = list + size / sizeof(*list);
 
 	/* Loop over the phandles until all the requested entry is found */
-- 
1.7.11.1

  reply	other threads:[~2012-06-29  4:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-29  4:57 [PATCH 0/2] More precise error reporting for of_get_named_gpio Alexandre Courbot
2012-06-29  4:57 ` Alexandre Courbot [this message]
2012-07-05 13:26   ` [PATCH 1/2] of: return -ENOENT when no property Linus Walleij
2012-07-05 14:20     ` Rob Herring
2012-06-29  4:57 ` [PATCH 2/2] gpio: propagate of_parse_phandle_with_args errors Alexandre Courbot
2012-07-05 13:27   ` Linus Walleij

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=1340945879-11712-2-git-send-email-acourbot@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob.herring@calxeda.com \
    /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).