summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/adp5520_bl.c
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2013-04-30 03:17:49 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 05:28:17 +0400
commit359177e0606d9b80d89f877ddd36d82b32a0cb72 (patch)
treeeb73dcab7db1f42e9e1cbafc045f16ebe8b56afd /drivers/video/backlight/adp5520_bl.c
parentd50d1ddbc0730fd341ab4fc7575ae4f6a84dfc7a (diff)
downloadlinux-359177e0606d9b80d89f877ddd36d82b32a0cb72.tar.xz
drivers/video/backlight/adp5520_bl.c: fix compiler warning in adp5520_show()
While compiling with make W=1 (gcc gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)) the following warning happens: drivers/video/backlight/adp5520_bl.c: In function `adp5520_show': drivers/video/backlight/adp5520_bl.c:146:6: warning: variable `error' set but not used [-Wunused-but-set-variable] fixed by checking the return value of the variable Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Acked-by: Jingoo Han <jg1.han@samsung.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/adp5520_bl.c')
-rw-r--r--drivers/video/backlight/adp5520_bl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c
index 962d120f6d0d..c84701b7ca6e 100644
--- a/drivers/video/backlight/adp5520_bl.c
+++ b/drivers/video/backlight/adp5520_bl.c
@@ -143,13 +143,16 @@ static int adp5520_bl_setup(struct backlight_device *bl)
static ssize_t adp5520_show(struct device *dev, char *buf, int reg)
{
struct adp5520_bl *data = dev_get_drvdata(dev);
- int error;
+ int ret;
uint8_t reg_val;
mutex_lock(&data->lock);
- error = adp5520_read(data->master, reg, &reg_val);
+ ret = adp5520_read(data->master, reg, &reg_val);
mutex_unlock(&data->lock);
+ if (ret < 0)
+ return ret;
+
return sprintf(buf, "%u\n", reg_val);
}