* [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
* Re: [PATCH RFC] regulator: suppress printk if there is no real info
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
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-08-07 18:10 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Liam Girdwood, linux-kernel, kernel
On Mon, Aug 06, 2012 at 11:18:40AM +0200, Uwe Kleine-König wrote:
> probably this really only applies to the dummy regulator. If not it
> might be more sensible to do:
> if (!buf[0])
> buf = "no parameters";
Yeah, having the log message for other regulators is helpful since
things often go boom after you mess with power but not so useful for
dummy.
> or similar. Other than that I wonder if setting the devicename from
> "dummy" to say "regulator-dummy" would be an improvement, too.
That'd work too.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] regulator: suppress printk if there is no real info
2012-08-07 18:10 ` Mark Brown
@ 2012-08-07 18:15 ` Uwe Kleine-König
2012-08-07 18:16 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2012-08-07 18:15 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel, kernel
On Tue, Aug 07, 2012 at 07:10:22PM +0100, Mark Brown wrote:
> On Mon, Aug 06, 2012 at 11:18:40AM +0200, Uwe Kleine-König wrote:
>
> > probably this really only applies to the dummy regulator. If not it
> > might be more sensible to do:
>
> > if (!buf[0])
> > buf = "no parameters";
>
> Yeah, having the log message for other regulators is helpful since
> things often go boom after you mess with power but not so useful for
> dummy.
That's a +1 for which approach?
> > or similar. Other than that I wonder if setting the devicename from
> > "dummy" to say "regulator-dummy" would be an improvement, too.
>
> That'd work too.
I'd like to combine it with one of the two suggested above.
If you answer my question I can follow up with a patch.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH RFC] regulator: suppress printk if there is no real info
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
0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2012-08-07 18:16 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Liam Girdwood, linux-kernel, kernel
On Tue, Aug 07, 2012 at 08:15:49PM +0200, Uwe Kleine-König wrote:
> On Tue, Aug 07, 2012 at 07:10:22PM +0100, Mark Brown wrote:
> > > if (!buf[0])
> > > buf = "no parameters";
> > Yeah, having the log message for other regulators is helpful since
> > things often go boom after you mess with power but not so useful for
> > dummy.
> That's a +1 for which approach?
The above one which preserves the log message.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] regulator: make the dummy regulator's print_constraint more helpful
2012-08-07 18:16 ` Mark Brown
@ 2012-08-07 19:01 ` Uwe Kleine-König
2012-08-08 13:32 ` Mark Brown
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2012-08-07 19:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: kernel, linux-kernel
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 <u.kleine-koenig@pengutronix.de>
---
drivers/regulator/core.c | 3 +++
drivers/regulator/dummy.c | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 8b4b382..1ca21cb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -808,6 +808,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 86f655c..03a1d7c 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,
--
1.7.10.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] regulator: make the dummy regulator's print_constraint more helpful
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
0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2012-08-08 13:32 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: Liam Girdwood, kernel, linux-kernel
On Tue, Aug 07, 2012 at 09:01:37PM +0200, Uwe Kleine-König wrote:
> This prevents the output of just
>
> dummy:
>
> in the boot log. Now it says:
>
> regulator-dummy: no parameters
Applied, thanks.
^ permalink raw reply [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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.