From 76dc17f264b5d1530f110187220923dc8f7db0a4 Mon Sep 17 00:00:00 2001 From: Vadim Pasternak Date: Sun, 23 Jul 2023 10:07:15 +0000 Subject: [PATCH backport 5.10.179 2/2] leds: mlxreg: Remove code for amber LED colour Remove unused code for amber LED colour. In case system LED color is "green", "orange" or "amber" same code is to be used for colour setting. Signed-off-by: Vadim Pasternak --- drivers/leds/leds-mlxreg.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/leds/leds-mlxreg.c b/drivers/leds/leds-mlxreg.c index e6b205d31..26039e187 100644 --- a/drivers/leds/leds-mlxreg.c +++ b/drivers/leds/leds-mlxreg.c @@ -22,7 +22,6 @@ #define MLXREG_LED_RED_SOLID 0x05 /* Solid red or orange */ #define MLXREG_LED_GREEN_SOLID_HW 0x09 /* Solid green by hardware */ #define MLXREG_LED_GREEN_SOLID 0x0D /* Solid green */ -#define MLXREG_LED_AMBER_SOLID 0x09 /* Solid amber */ #define MLXREG_LED_BLINK_3HZ 167 /* ~167 msec off/on - HW support */ #define MLXREG_LED_BLINK_6HZ 83 /* ~83 msec off/on - HW support */ #define MLXREG_LED_CAPABILITY_CLEAR GENMASK(31, 8) /* Clear mask */ @@ -262,16 +261,11 @@ static int mlxreg_led_config(struct mlxreg_led_priv_data *priv) led_cdev = &led_data->led_cdev; led_data->data_parent = priv; - if (strstr(data->label, "red")) { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_RED_SOLID; - } else if (strstr(data->label, "orange")) { + if (strstr(data->label, "red") || strstr(data->label, "orange") || + strstr(data->label, "amber")) { brightness = LED_OFF; led_data->base_color = MLXREG_LED_RED_SOLID; led_data->base_color_hw = MLXREG_LED_RED_SOLID_HW; - } else if (strstr(data->label, "amber")) { - brightness = LED_OFF; - led_data->base_color = MLXREG_LED_AMBER_SOLID; } else { brightness = LED_OFF; led_data->base_color = MLXREG_LED_GREEN_SOLID; -- 2.20.1