Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Mark Brown
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Uwe Kleine-König
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/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Mark Brown
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Mark Brown
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.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Uwe Kleine-König
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/  |
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH RFC] regulator: suppress printk if there is no real info

2012-08-07 Thread Mark Brown
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.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH RFC] regulator: suppress printk if there is no real info

2012-08-06 Thread Uwe Kleine-König
This prevents the output of just

dummy:

in the boot log.

Signed-off-by: Uwe Kleine-König 
---
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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH RFC] regulator: suppress printk if there is no real info

2012-08-06 Thread Uwe Kleine-König
This prevents the output of just

dummy:

in the boot log.

Signed-off-by: Uwe Kleine-König u.kleine-koe...@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

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/