[PATCH RFC] regulator: suppress printk if there is no real info
From: Uwe Kleine-KÃnig
Date: Mon Aug 06 2012 - 05:19:17 EST
This prevents the output of just
dummy:
in the boot log.
Signed-off-by: Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/