[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1327960820-11867-17-git-send-email-danny.kukawka@bisect.de>
Date: Mon, 30 Jan 2012 23:00:20 +0100
From: Danny Kukawka <danny.kukawka@...ect.de>
To: Richard Purdie <rpurdie@...ys.net>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH v2 16/16] leds-lp5523: fix compiler warning
Fix for some -Wuninitialized compiler warnings.
Signed-off-by: Danny Kukawka <danny.kukawka@...ect.de>
---
drivers/leds/leds-lp5523.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 73e791a..c11fce0 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -192,7 +192,7 @@ static int lp5523_detect(struct i2c_client *client)
static int lp5523_configure(struct i2c_client *client)
{
struct lp5523_chip *chip = i2c_get_clientdata(client);
- int ret = 0;
+ int ret = 0, ret2 = 0;
u8 status;
/* one pattern per engine setting led mux start and stop addresses */
@@ -243,7 +243,10 @@ static int lp5523_configure(struct i2c_client *client)
/* Let the programs run for couple of ms and check the engine status */
usleep_range(3000, 6000);
- lp5523_read(client, LP5523_REG_STATUS, &status);
+ ret2 = lp5523_read(client, LP5523_REG_STATUS, &status);
+ if (ret2)
+ return -1;
+
status &= LP5523_ENG_STATUS_MASK;
if (status == LP5523_ENG_STATUS_MASK) {
@@ -461,7 +464,10 @@ static ssize_t lp5523_selftest(struct device *dev,
if (!(status & LP5523_LEDTEST_DONE))
usleep_range(3000, 6000); /* Was not ready. Wait little bit */
- ret |= lp5523_read(chip->client, LP5523_REG_LED_TEST_ADC, &vdd);
+ ret = lp5523_read(chip->client, LP5523_REG_LED_TEST_ADC, &vdd);
+ if (ret)
+ goto fail;
+
vdd--; /* There may be some fluctuation in measurement */
for (i = 0; i < LP5523_LEDS; i++) {
@@ -485,7 +491,9 @@ static ssize_t lp5523_selftest(struct device *dev,
ret = lp5523_read(chip->client, LP5523_REG_STATUS, &status);
if (!(status & LP5523_LEDTEST_DONE))
usleep_range(3000, 6000);/* Was not ready. Wait. */
- ret |= lp5523_read(chip->client, LP5523_REG_LED_TEST_ADC, &adc);
+ ret = lp5523_read(chip->client, LP5523_REG_LED_TEST_ADC, &adc);
+ if (ret)
+ goto fail;
if (adc >= vdd || adc < LP5523_ADC_SHORTCIRC_LIM)
pos += sprintf(buf + pos, "LED %d FAIL\n", i);
--
1.7.7.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists