leds: pwm: Fix an error code

Message ID 20230711083055.1274409-1-fshao@chromium.org
State New
Headers
Series leds: pwm: Fix an error code |

Commit Message

Fei Shao July 11, 2023, 8:30 a.m. UTC
  Use the negated -EINVAL as the error code.

Fixes: 95138e01275e ("leds: pwm: Make error handling more robust")
Signed-off-by: Fei Shao <fshao@chromium.org>

---

 drivers/leds/leds-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andy Shevchenko July 11, 2023, 9:09 a.m. UTC | #1
On Tue, Jul 11, 2023 at 11:31 AM Fei Shao <fshao@chromium.org> wrote:
>
> Use the negated -EINVAL as the error code.

Thank you, it seems Dan had been the first one.

Message ID <a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain>
  
Fei Shao July 11, 2023, 9:20 a.m. UTC | #2
Hi Andy,

On Tue, Jul 11, 2023 at 5:10 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Jul 11, 2023 at 11:31 AM Fei Shao <fshao@chromium.org> wrote:
> >
> > Use the negated -EINVAL as the error code.
>
> Thank you, it seems Dan had been the first one.
>
> Message ID <a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain>
Thanks for the pointer. Please disregard this patch.

Regards,
Fei
>
> --
> With Best Regards,
> Andy Shevchenko
  
Lee Jones July 12, 2023, noon UTC | #3
On Tue, 11 Jul 2023, Andy Shevchenko wrote:

> On Tue, Jul 11, 2023 at 11:31 AM Fei Shao <fshao@chromium.org> wrote:
> >
> > Use the negated -EINVAL as the error code.
> 
> Thank you, it seems Dan had been the first one.
> 
> Message ID <a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain>

I don't know much about how other people operate, but I have no way to
trivially navigate to this.  Would you be kind enough to use URLs
please?
  
Andy Shevchenko July 12, 2023, 12:49 p.m. UTC | #4
On Wed, Jul 12, 2023 at 3:00 PM Lee Jones <lee@kernel.org> wrote:
> On Tue, 11 Jul 2023, Andy Shevchenko wrote:
>
> > On Tue, Jul 11, 2023 at 11:31 AM Fei Shao <fshao@chromium.org> wrote:
> > >
> > > Use the negated -EINVAL as the error code.
> >
> > Thank you, it seems Dan had been the first one.
> >
> > Message ID <a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain>
>
> I don't know much about how other people operate, but I have no way to
> trivially navigate to this.  Would you be kind enough to use URLs
> please?

Use this pattern:
  https://lore.kernel.org/r/$MSG_ID
where $MSG_ID is a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain
in this case.

Hence, the URL:
https://lore.kernel.org/r/a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain

Easier way is simply run `b4 mbox $MSG_ID` and open the loaded mbox
with your preferred MUA.
  
Lee Jones July 12, 2023, 1:07 p.m. UTC | #5
On Wed, 12 Jul 2023, Andy Shevchenko wrote:

> On Wed, Jul 12, 2023 at 3:00 PM Lee Jones <lee@kernel.org> wrote:
> > On Tue, 11 Jul 2023, Andy Shevchenko wrote:
> >
> > > On Tue, Jul 11, 2023 at 11:31 AM Fei Shao <fshao@chromium.org> wrote:
> > > >
> > > > Use the negated -EINVAL as the error code.
> > >
> > > Thank you, it seems Dan had been the first one.
> > >
> > > Message ID <a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain>
> >
> > I don't know much about how other people operate, but I have no way to
> > trivially navigate to this.  Would you be kind enough to use URLs
> > please?
> 
> Use this pattern:
>   https://lore.kernel.org/r/$MSG_ID
> where $MSG_ID is a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain
> in this case.
> 
> Hence, the URL:
> https://lore.kernel.org/r/a33b981a-b2c4-4dc2-b00a-626a090d2f11@moroto.mountain
> 
> Easier way is simply run `b4 mbox $MSG_ID` and open the loaded mbox
> with your preferred MUA.

Right, I'm aware that I can manually manipulate the lore URL in this way.

However I, like many, do not have a way to do this easily from my mailer.

This is why directly navigatable / clickable URLs were invented. :)

Please could you use full / clickable URLs to messages?
  

Patch

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 29194cc382af..87c199242f3c 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -146,7 +146,7 @@  static int led_pwm_create_fwnode(struct device *dev, struct led_pwm_priv *priv)
 			led.name = to_of_node(fwnode)->name;
 
 		if (!led.name) {
-			ret = EINVAL;
+			ret = -EINVAL;
 			goto err_child_out;
 		}