leds: lm3642: Return proper error in lm3642_[torch|strobe]_pin_store error paths
authorAxel Lin <axel.lin@ingics.com>
Mon, 8 Oct 2012 03:54:23 +0000 (20:54 -0700)
committerBryan Wu <cooloney@gmail.com>
Mon, 26 Nov 2012 22:28:42 +0000 (14:28 -0800)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: G.Shark Jeong <gshark.jeong@gmail.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-lm3642.c

index 3285006e988820ebb763ef47709842549d6bad5e..b69acac6d711cad1245cf263c7679505ef4561fb 100644 (file)
@@ -201,10 +201,10 @@ static ssize_t lm3642_torch_pin_store(struct device *dev,
        return size;
 out:
        dev_err(chip->dev, "%s:i2c access fail to register\n", __func__);
-       return size;
+       return ret;
 out_strtoint:
        dev_err(chip->dev, "%s: fail to change str to int\n", __func__);
-       return size;
+       return ret;
 }
 
 static DEVICE_ATTR(torch_pin, 0666, NULL, lm3642_torch_pin_store);
@@ -258,10 +258,10 @@ static ssize_t lm3642_strobe_pin_store(struct device *dev,
        return size;
 out:
        dev_err(chip->dev, "%s:i2c access fail to register\n", __func__);
-       return size;
+       return ret;
 out_strtoint:
        dev_err(chip->dev, "%s: fail to change str to int\n", __func__);
-       return size;
+       return ret;
 }
 
 static DEVICE_ATTR(strobe_pin, 0666, NULL, lm3642_strobe_pin_store);