summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c4
-rw-r--r--drivers/video/backlight/adp8860_bl.c2
-rw-r--r--drivers/video/backlight/adp8870_bl.c2
-rw-r--r--drivers/video/backlight/backlight.c15
-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