linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds/leds-pwm: Display error code on request_pwm failure
@ 2013-12-17  0:08 Ben Gamari
  2013-12-17  1:26 ` Bryan Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Ben Gamari @ 2013-12-17  0:08 UTC (permalink / raw)
  To: Bryan Wu, Richard Purdie; +Cc: linux-leds, Ben Gamari

This can be useful in debugging devicetrees.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
---
 drivers/leds/leds-pwm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index b31d8e9..707a82a 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -165,8 +165,8 @@ static int led_pwm_probe(struct platform_device *pdev)
 			if (IS_ERR(led_dat->pwm)) {
 				ret = PTR_ERR(led_dat->pwm);
 				dev_err(&pdev->dev,
-					"unable to request PWM for %s\n",
-					cur_led->name);
+					"unable to request PWM for %s: error=%d\n",
+					cur_led->name, ret);
 				goto err;
 			}
 
-- 
1.8.3.2

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

* Re: [PATCH] leds/leds-pwm: Display error code on request_pwm failure
  2013-12-17  0:08 [PATCH] leds/leds-pwm: Display error code on request_pwm failure Ben Gamari
@ 2013-12-17  1:26 ` Bryan Wu
  2013-12-17  1:28   ` Bryan Wu
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Wu @ 2013-12-17  1:26 UTC (permalink / raw)
  To: Ben Gamari; +Cc: Richard Purdie, Linux LED Subsystem

On Mon, Dec 16, 2013 at 4:08 PM, Ben Gamari <bgamari.foss@gmail.com> wrote:
> This can be useful in debugging devicetrees.
>

OK, I will merge this.

Thanks,
-Bryan

> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
> ---
>  drivers/leds/leds-pwm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> index b31d8e9..707a82a 100644
> --- a/drivers/leds/leds-pwm.c
> +++ b/drivers/leds/leds-pwm.c
> @@ -165,8 +165,8 @@ static int led_pwm_probe(struct platform_device *pdev)
>                         if (IS_ERR(led_dat->pwm)) {
>                                 ret = PTR_ERR(led_dat->pwm);
>                                 dev_err(&pdev->dev,
> -                                       "unable to request PWM for %s\n",
> -                                       cur_led->name);
> +                                       "unable to request PWM for %s: error=%d\n",
> +                                       cur_led->name, ret);
>                                 goto err;
>                         }
>
> --
> 1.8.3.2
>

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

* Re: [PATCH] leds/leds-pwm: Display error code on request_pwm failure
  2013-12-17  1:26 ` Bryan Wu
@ 2013-12-17  1:28   ` Bryan Wu
  2013-12-17  4:05     ` Ben Gamari
  0 siblings, 1 reply; 4+ messages in thread
From: Bryan Wu @ 2013-12-17  1:28 UTC (permalink / raw)
  To: Ben Gamari; +Cc: Richard Purdie, Linux LED Subsystem

On Mon, Dec 16, 2013 at 5:26 PM, Bryan Wu <cooloney@gmail.com> wrote:
> On Mon, Dec 16, 2013 at 4:08 PM, Ben Gamari <bgamari.foss@gmail.com> wrote:
>> This can be useful in debugging devicetrees.
>>
>
> OK, I will merge this.
>


> Thanks,
> -Bryan
>
>> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
>> ---
>>  drivers/leds/leds-pwm.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
>> index b31d8e9..707a82a 100644
>> --- a/drivers/leds/leds-pwm.c
>> +++ b/drivers/leds/leds-pwm.c
>> @@ -165,8 +165,8 @@ static int led_pwm_probe(struct platform_device *pdev)
>>                         if (IS_ERR(led_dat->pwm)) {
>>                                 ret = PTR_ERR(led_dat->pwm);
>>                                 dev_err(&pdev->dev,
>> -                                       "unable to request PWM for %s\n",
>> -                                       cur_led->name);
>> +                                       "unable to request PWM for %s: error=%d\n",

Oh, hold on, this line has more than 80 characters. Please fix this
coding style error.

-Bryan

>> +                                       cur_led->name, ret);
>>                                 goto err;
>>                         }
>>
>> --
>> 1.8.3.2
>>

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

* Re: [PATCH] leds/leds-pwm: Display error code on request_pwm failure
  2013-12-17  1:28   ` Bryan Wu
@ 2013-12-17  4:05     ` Ben Gamari
  0 siblings, 0 replies; 4+ messages in thread
From: Ben Gamari @ 2013-12-17  4:05 UTC (permalink / raw)
  To: Bryan Wu; +Cc: Richard Purdie, Linux LED Subsystem

[-- Attachment #1: Type: text/plain, Size: 1754 bytes --]

Bryan Wu <cooloney@gmail.com> writes:

> On Mon, Dec 16, 2013 at 5:26 PM, Bryan Wu <cooloney@gmail.com> wrote:
>> On Mon, Dec 16, 2013 at 4:08 PM, Ben Gamari <bgamari.foss@gmail.com> wrote:
>>> This can be useful in debugging devicetrees.
>>>
>>
>> OK, I will merge this.
>>
>
>
>> Thanks,
>> -Bryan
>>
>>> Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
>>> ---
>>>  drivers/leds/leds-pwm.c | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
>>> index b31d8e9..707a82a 100644
>>> --- a/drivers/leds/leds-pwm.c
>>> +++ b/drivers/leds/leds-pwm.c
>>> @@ -165,8 +165,8 @@ static int led_pwm_probe(struct platform_device *pdev)
>>>                         if (IS_ERR(led_dat->pwm)) {
>>>                                 ret = PTR_ERR(led_dat->pwm);
>>>                                 dev_err(&pdev->dev,
>>> -                                       "unable to request PWM for %s\n",
>>> -                                       cur_led->name);
>>> +                                       "unable to request PWM for %s: error=%d\n",
>
> Oh, hold on, this line has more than 80 characters. Please fix this
> coding style error.
>
Would this not fall under the "unless" clause of the kernel style guidelines,

    Statements longer than 80 columns will be broken into sensible chunks, unless
    exceeding 80 columns significantly increases readability and does not hide
    information.

The line is 82 characters long by my count and there is no reasonable
way to break it. The only fix I can think of here is to introduce a
local variable for the format string but in my opinion this is far less
readable than what we currently have. Which would you prefer?

Cheers,

- Ben

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

end of thread, other threads:[~2013-12-17  4:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17  0:08 [PATCH] leds/leds-pwm: Display error code on request_pwm failure Ben Gamari
2013-12-17  1:26 ` Bryan Wu
2013-12-17  1:28   ` Bryan Wu
2013-12-17  4:05     ` Ben Gamari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).