]> git.ipfire.org Git - thirdparty/linux.git/commit
leds: core: Omit set_brightness error message for a LED supporting hw trigger only
authorLee Jones <lee@kernel.org>
Wed, 12 Jun 2024 15:36:40 +0000 (16:36 +0100)
committerLee Jones <lee@kernel.org>
Wed, 26 Jun 2024 15:55:44 +0000 (16:55 +0100)
commitd33d1214a1ddf9e7e4d14c62637518252927f0be
tree45f2fb94a326a591b6f0f8963fae9dc564dacddf
parent6f963a20eed72b9abb54754cc935ce546b66b451
leds: core: Omit set_brightness error message for a LED supporting hw trigger only

If both set_brightness functions return -ENOTSUPP, then the LED doesn't
support setting a fixed brightness value, and the error message isn't
helpful. This can be the case e.g. for LEDs supporting a specific hw
trigger only.

Pinched the subject line and commit message from Heiner:
Link: https://lore.kernel.org/all/44177e37-9512-4044-8991-bb23b184bf37@gmail.com/
Reworked the function to provide Heiner's required semantics whilst
simultaneously increasing readability and flow.

Cc: Pavel Machek <pavel@ucw.cz>
Cc: linux-leds@vger.kernel.org
Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/leds/led-core.c