lkml.org 
[lkml]   [2021]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 02/28] leds: core: The -ENOTSUPP should never be seen by user space
On Mon 2021-05-10 12:50:19, Andy Shevchenko wrote:
> Replace -ENOTSUPP by -EOPNOTSUPP when returning from exported function.
>
> Fixes: 13ae79bbe4c2 ("leds: core: Drivers shouldn't enforce SYNC/ASYNC brightness setting")
> Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Are you sure this is real problem? This does not sound like an error
path that should happen.

BR,
Pavel

> int led_set_brightness_sync(struct led_classdev *led_cdev, unsigned int value)
> {
> + int ret;
> +
> if (led_cdev->blink_delay_on || led_cdev->blink_delay_off)
> return -EBUSY;
>
> @@ -297,7 +299,10 @@ int led_set_brightness_sync(struct led_classdev *led_cdev, unsigned int value)
> if (led_cdev->flags & LED_SUSPENDED)
> return 0;
>
> - return __led_set_brightness_blocking(led_cdev, led_cdev->brightness);
> + ret = __led_set_brightness_blocking(led_cdev, led_cdev->brightness);
> + if (ret == -ENOTSUPP)
> + return -EOPNOTSUPP;
> + return ret;
> }
> EXPORT_SYMBOL_GPL(led_set_brightness_sync);
>

--
http://www.livejournal.com/~pavelmachek
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-05-28 12:05    [W:0.285 / U:1.636 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site