diff mbox

[PATCHv2,2/3] pwm: push up dynamic printk level on errors in of_pwm_get()

Message ID 1413210099-7862-1-git-send-email-vladimir_zapolskiy@mentor.com
State New
Headers show

Commit Message

Vladimir Zapolskiy Oct. 13, 2014, 2:21 p.m. UTC
The changed three user messages on fault are printed under pr_debug(),
however all of them are unrecoverable and result in failed pwm device
registration, report this to a user.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: Lothar Waßmann <LW@KARO-electronics.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
---
Changes from v1 to v2:
- corrected the proper kernel log level, thanks to Lothar Waßmann.

 drivers/pwm/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Vladimir Zapolskiy Oct. 13, 2014, 2:21 p.m. UTC | #1
Please review this alternative in-house version of supporting backward
compatibility of DTB files, if pwms arguments of exisitng PWM drivers
are to be extended with polarity field.

Unfortunately I've firstly created the change and only after that
found that Lothar Waßmann is working on his version, so I won't insist
on formal preference, but still I like to share my variant since it
technically different from Lothar's one.

One visual benefit of my verison is that if this version is accepted,
then of_pwm_xlate_with_flags() can be removed from all touched PWM
drivers and pwm/core.c as a redundant interface, chip.of_pwm_n_cells
should not be updated also, and generally is looks to be a more simple
change.

The particular changes in iMX PWM driver and other PWM drivers are out
of this change scope.

Changes from v1 to v2:
- corrected the proper kernel log level, thanks to Lothar Waßmann.

Vladimir Zapolskiy (3):
  pwm: process pwm polarity argument in of_pwm_simple_xlate()
  pwm: push up dynamic printk level on errors in of_pwm_get()
  pwm: set the actual number of pwms arguments defined in board dts

 drivers/pwm/core.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 681d154..f6231c6 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -532,19 +532,19 @@  struct pwm_device *of_pwm_get(struct device_node *np, const char *con_id)
 	err = of_parse_phandle_with_args(np, "pwms", "#pwm-cells", index,
 					 &args);
 	if (err) {
-		pr_debug("%s(): can't parse \"pwms\" property\n", __func__);
+		pr_err("%s(): can't parse \"pwms\" property\n", __func__);
 		return ERR_PTR(err);
 	}
 
 	pc = of_node_to_pwmchip(args.np);
 	if (IS_ERR(pc)) {
-		pr_debug("%s(): PWM chip not found\n", __func__);
+		pr_err("%s(): PWM chip not found\n", __func__);
 		pwm = ERR_CAST(pc);
 		goto put;
 	}
 
 	if (args.args_count != pc->of_pwm_n_cells) {
-		pr_debug("%s: wrong #pwm-cells for %s\n", np->full_name,
+		pr_err("%s: wrong #pwm-cells for %s\n", np->full_name,
 			 args.np->full_name);
 		pwm = ERR_PTR(-EINVAL);
 		goto put;