]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drivers/leds/leds-lp5521.c: fix lp5521_read() error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 3 May 2012 05:44:22 +0000 (15:44 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 3 May 2012 05:46:46 +0000 (15:46 +1000)
commit2a99227d741be062616c92e2c695ded0ed319b14
tree38e64e6c2ef679d92098ec7aa0eb0d01b00ffc21
parent2236528a706edc7bdb6f61522f157acbdef0c09d
drivers/leds/leds-lp5521.c: fix lp5521_read() error handling

Gcc 4.6.2 complains that:
drivers/leds/leds-lp5521.c: In function `lp5521_load_program':
drivers/leds/leds-lp5521.c:214:21: warning: `mode' may be used uninitialized in this function [-Wuninitialized]
drivers/leds/leds-lp5521.c: In function `lp5521_probe':
drivers/leds/leds-lp5521.c:788:5: warning: `buf' may be used uninitialized in this function [-Wuninitialized]
drivers/leds/leds-lp5521.c:740:6: warning: `ret' may be used uninitialized in this function [-Wuninitialized]

These are real problems if lp5521_read() returns an error.  When that
happens we should handle it, instead of ignoring it or doing a bitwise OR
with all the other error codes and continuing.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Milo <Milo.Kim@ti.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/leds/leds-lp5521.c