devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: [PATCH] pinctrl: add error message to pinmux_map_to_setting's error path
Date: Mon, 23 Apr 2012 19:40:06 +0200	[thread overview]
Message-ID: <1335202806-19520-1-git-send-email-blogic@openwrt.org> (raw)

If a non existent mux group is referenced inside a devicetree, we see no error.

This patch adds the same type of error message that pinconf_map_to_setting()
gives when the pin/group is unknown.

Signed-off-by: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
Cc: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

---
 drivers/pinctrl/pinmux.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index 1056e68..7c840fb 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -349,8 +349,11 @@ int pinmux_map_to_setting(struct pinctrl_map const *map,
 				break;
 			}
 		}
-		if (!found)
+		if (!found) {
+			dev_err(pctldev->dev, "could not find mux group \"%s\"",
+				group);
 			return -EINVAL;
+		}
 	} else {
 		group = groups[0];
 	}
-- 
1.7.9.1

             reply	other threads:[~2012-04-23 17:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23 17:40 John Crispin [this message]
     [not found] ` <1335202806-19520-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-04-23 18:37   ` [PATCH] pinctrl: add error message to pinmux_map_to_setting's error path Stephen Warren
     [not found]     ` <4F95A162.3080200-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-23 18:49       ` John Crispin

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=1335202806-19520-1-git-send-email-blogic@openwrt.org \
    --to=blogic-p3rkhjxn3npafugrpc6u6w@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).