From: Uwe Kleine-König Date: Tue, 7 Aug 2012 19:01:37 +0000 (+0200) Subject: regulator: make the dummy regulator's print_constraint more helpful X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=215b8b055de7dad26ab6c10f70130934309cb696;p=linux-beck.git regulator: make the dummy regulator's print_constraint more helpful This prevents the output of just dummy: in the boot log. Now it says: regulator-dummy: no parameters which at least doesn't make it look like an accidental printk and also doesn't only use "dummy" which could mean anything. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5f2221095a46..157def15ed78 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -778,6 +778,9 @@ static void print_constraints(struct regulator_dev *rdev) if (constraints->valid_modes_mask & REGULATOR_MODE_STANDBY) count += sprintf(buf + count, "standby"); + if (!count) + sprintf(buf, "no parameters"); + rdev_info(rdev, "%s\n", buf); if ((constraints->min_uV != constraints->max_uV) && diff --git a/drivers/regulator/dummy.c b/drivers/regulator/dummy.c index 86f655c7f7a1..03a1d7c11ef2 100644 --- a/drivers/regulator/dummy.c +++ b/drivers/regulator/dummy.c @@ -30,7 +30,7 @@ static struct regulator_init_data dummy_initdata; static struct regulator_ops dummy_ops; static struct regulator_desc dummy_desc = { - .name = "dummy", + .name = "regulator-dummy", .id = -1, .type = REGULATOR_VOLTAGE, .owner = THIS_MODULE,