diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 13:38:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-07 13:38:26 -0700 |
commit | df7cb187edc726fe78f2c9818fb8eb534a61541c (patch) | |
tree | 53ff8df8d74ac01eb8f916962b004eb6f703d4a6 | |
parent | 6972b007ca771e33dec992ccd104c95a97a186e5 (diff) | |
parent | 056d6ff470a8e782648fd020940c04d0d4a0d761 (diff) | |
download | linux-stable-df7cb187edc726fe78f2c9818fb8eb534a61541c.tar.gz linux-stable-df7cb187edc726fe78f2c9818fb8eb534a61541c.tar.bz2 linux-stable-df7cb187edc726fe78f2c9818fb8eb534a61541c.zip |
Merge tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight
Pull backlight updates from Lee Jones:
"Core Framework:
- Report correct error status to user
Fix-ups:
- Move Backlight headers out of I2C (adp8860, adp8870)"
* tag 'backlight-next-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
video: adp8870: move header file out of I2C realm
backlight: adp8860: Move header file out of I2C realm
backlight: Report error on failure
-rw-r--r-- | arch/blackfin/mach-bf537/boards/stamp.c | 4 | ||||
-rw-r--r-- | drivers/video/backlight/adp8860_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/adp8870_bl.c | 2 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 15 | ||||
-rw-r--r-- | include/linux/platform_data/adp8860.h (renamed from include/linux/i2c/adp8860.h) | 0 | ||||
-rw-r--r-- | include/linux/platform_data/adp8870.h (renamed from include/linux/i2c/adp8870.h) | 0 |
6 files changed, 14 insertions, 9 deletions
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c index 24985e658c19..7528148dc492 100644 --- a/arch/blackfin/mach-bf537/boards/stamp.c +++ b/arch/blackfin/mach-bf537/boards/stamp.c @@ -1995,7 +1995,7 @@ static struct adp5588_gpio_platform_data adp5588_gpio_data = { #endif #if IS_ENABLED(CONFIG_BACKLIGHT_ADP8870) -#include <linux/i2c/adp8870.h> +#include <linux/platform_data/adp8870.h> static struct led_info adp8870_leds[] = { { .name = "adp8870-led7", @@ -2047,7 +2047,7 @@ static struct adp8870_backlight_platform_data adp8870_pdata = { #endif #if IS_ENABLED(CONFIG_BACKLIGHT_ADP8860) -#include <linux/i2c/adp8860.h> +#include <linux/platform_data/adp8860.h> static struct led_info adp8860_leds[] = { { .name = "adp8860-led7", diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 510e559c060e..e7315bf14d60 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -18,7 +18,7 @@ #include <linux/slab.h> #include <linux/workqueue.h> -#include <linux/i2c/adp8860.h> +#include <linux/platform_data/adp8860.h> #define ADP8860_EXT_FEATURES #define ADP8860_USE_LEDS diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 21acac90fd77..058d1def2d1f 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -18,7 +18,7 @@ #include <linux/workqueue.h> #include <linux/slab.h> -#include <linux/i2c/adp8870.h> +#include <linux/platform_data/adp8870.h> #define ADP8870_EXT_FEATURES #define ADP8870_USE_LEDS diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 288318ad21dd..8049e7656daa 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -134,7 +134,7 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, { int rc; struct backlight_device *bd = to_backlight_device(dev); - unsigned long power; + unsigned long power, old_power; rc = kstrtoul(buf, 0, &power); if (rc) @@ -145,10 +145,16 @@ static ssize_t bl_power_store(struct device *dev, struct device_attribute *attr, if (bd->ops) { pr_debug("set power to %lu\n", power); if (bd->props.power != power) { + old_power = bd->props.power; bd->props.power = power; - backlight_update_status(bd); + rc = backlight_update_status(bd); + if (rc) + bd->props.power = old_power; + else + rc = count; + } else { + rc = count; } - rc = count; } mutex_unlock(&bd->ops_lock); @@ -176,8 +182,7 @@ int backlight_device_set_brightness(struct backlight_device *bd, else { pr_debug("set brightness to %lu\n", brightness); bd->props.brightness = brightness; - backlight_update_status(bd); - rc = 0; + rc = backlight_update_status(bd); } } mutex_unlock(&bd->ops_lock); diff --git a/include/linux/i2c/adp8860.h b/include/linux/platform_data/adp8860.h index 0b4d39855c91..0b4d39855c91 100644 --- a/include/linux/i2c/adp8860.h +++ b/include/linux/platform_data/adp8860.h diff --git a/include/linux/i2c/adp8870.h b/include/linux/platform_data/adp8870.h index 624dceccbd5b..624dceccbd5b 100644 --- a/include/linux/i2c/adp8870.h +++ b/include/linux/platform_data/adp8870.h |