public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] regulator: suppress printk if there is no real info
@ 2012-08-06  9:18 Uwe Kleine-König
  2012-08-07 18:10 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2012-08-06  9:18 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown; +Cc: linux-kernel, kernel

This prevents the output of just

	dummy:

in the boot log.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

probably this really only applies to the dummy regulator. If not it
might be more sensible to do:

	if (!buf[0])
		buf = "no parameters";

or similar. Other than that I wonder if setting the devicename from
"dummy" to say "regulator-dummy" would be an improvement, too.

Best regards
Uwe

 drivers/regulator/core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8b4b382..9275259 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -808,7 +808,8 @@ static void print_constraints(struct regulator_dev *rdev)
 	if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY)
 		count += sprintf(buf + count, "standby");
 
-	rdev_info(rdev, "%s\n", buf);
+	if (buf[0])
+		rdev_info(rdev, "%s\n", buf);
 
 	if ((constraints->min_uV != constraints->max_uV) &&
 	    !(constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE))
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-08-08 13:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-06  9:18 [PATCH RFC] regulator: suppress printk if there is no real info Uwe Kleine-König
2012-08-07 18:10 ` Mark Brown
2012-08-07 18:15   ` Uwe Kleine-König
2012-08-07 18:16     ` Mark Brown
2012-08-07 19:01       ` [PATCH v2] regulator: make the dummy regulator's print_constraint more helpful Uwe Kleine-König
2012-08-08 13:32         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox