Commit fbab3698 authored by Eddie James's avatar Eddie James Committed by Greg Kroah-Hartman
Browse files

hwmon: (pmbus/ibm-cffps) Switch LEDs to blocking brightness call

commit 9861ff95


Since i2c_smbus functions can sleep, the brightness setting function
for this driver must be the blocking version to avoid scheduling while
Signed-off-by: default avatarEddie James <>
Fixes: ef9e1cdf

 ("hwmon: (pmbus/cffps) Add led class device for power supply fault led")
Signed-off-by: default avatarGuenter Roeck <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 0b7cd89c
......@@ -269,7 +269,7 @@ static int ibm_cffps_read_word_data(struct i2c_client *client, int page,
return rc;
static void ibm_cffps_led_brightness_set(struct led_classdev *led_cdev,
static int ibm_cffps_led_brightness_set(struct led_classdev *led_cdev,
enum led_brightness brightness)
int rc;
......@@ -286,9 +286,11 @@ static void ibm_cffps_led_brightness_set(struct led_classdev *led_cdev,
rc = i2c_smbus_write_byte_data(psu->client, CFFPS_SYS_CONFIG_CMD,
if (rc < 0)
return rc;
led_cdev->brightness = brightness;
return 0;
static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev,
......@@ -324,7 +326,7 @@ static void ibm_cffps_create_led_class(struct ibm_cffps *psu)
psu-> = psu->led_name;
psu->led.max_brightness = LED_FULL;
psu->led.brightness_set = ibm_cffps_led_brightness_set;
psu->led.brightness_set_blocking = ibm_cffps_led_brightness_set;
psu->led.blink_set = ibm_cffps_led_blink_set;
rc = devm_led_classdev_register(dev, &psu->led);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment