LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Matheus Castello <matheus@castello.eng.br>
To: linus.walleij@linaro.org
Cc: linux-kernel@vger.kernel.org, Matheus Castello <matheus@castello.eng.br>
Subject: [PATCH v1 2/2] pinctrl: generic: improve apply_setting error verbosity
Date: Tue,  1 May 2018 03:40:37 -0400	[thread overview]
Message-ID: <1525160437-5222-3-git-send-email-matheus@castello.eng.br> (raw)
In-Reply-To: <1525160437-5222-1-git-send-email-matheus@castello.eng.br>

For generic pinconf: print the dev_error with the pinctrl vendor
driver name, error code, the sub-node property name used and the
pin that was tried to set.

Improves the undestading of the error if use a generic sub-node
property that generic-pinconf can do parse but the vendor pinctrl
driver does not support.

Signed-off-by: Matheus Castello <matheus@castello.eng.br>
---
 drivers/pinctrl/pinconf.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index d3fe143..fd5962a 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -21,6 +21,7 @@
 #include <linux/pinctrl/machine.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinconf.h>
+#include <linux/pinctrl/pinconf-generic.h>
 #include "core.h"
 #include "pinconf.h"
 
@@ -169,9 +170,21 @@ int pinconf_apply_setting(const struct pinctrl_setting *setting)
 				setting->data.configs.configs,
 				setting->data.configs.num_configs);
 		if (ret < 0) {
+#ifdef CONFIG_GENERIC_PINCONF
 			dev_err(pctldev->dev,
-				"pin_config_set op failed for pin %d\n",
+				"%s error %d seting %s for pin %d\n",
+				pctldev->desc->name, ret,
+				pinconf_generic_get_param_property_name(
+					pctldev, setting->data.configs.num_configs,
+					setting->data.configs.configs),
 				setting->data.configs.group_or_pin);
+#endif
+
+			dev_err(pctldev->dev,
+				"pin_config_set op failed for %s pin %d\n",
+				pctldev->desc->name,
+				setting->data.configs.group_or_pin);
+
 			return ret;
 		}
 		break;
-- 
2.7.4

  parent reply	other threads:[~2018-05-01  8:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-01  7:40 [PATCH v1 0/2] " Matheus Castello
2018-05-01  7:40 ` [PATCH v1 1/2] pinctrl: generic: add API to solve generic sub-node property name Matheus Castello
2018-05-01  7:40 ` Matheus Castello [this message]
2018-05-01  8:34   ` [PATCH v1 2/2] pinctrl: generic: improve apply_setting error verbosity kbuild test robot
2018-05-01 10:05   ` kbuild test robot
2018-05-01 19:09     ` [PATCH v2 0/2] " Matheus Castello
2018-05-01 19:10       ` [PATCH v2 1/2] pinctrl: generic: add API to solve generic sub-node property name Matheus Castello
2018-05-02 12:56         ` Linus Walleij
2018-05-01 19:10       ` [PATCH v2 2/2] pinctrl: generic: improve apply_setting error verbosity Matheus Castello
2018-05-02 12:51         ` Linus Walleij
2018-05-08  5:27           ` Matheus Castello

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=1525160437-5222-3-git-send-email-matheus@castello.eng.br \
    --to=matheus@castello.eng.br \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH v1 2/2] pinctrl: generic: improve apply_setting error verbosity' \
    /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

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).