aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2010-10-22 07:57:34 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-10-25 17:44:59 -0400
commitb11e7b3f3b56119194234085d42a633ceabd6aba (patch)
treeba12e182a53f74f78e8c35f05699b2a7b03f82e3 /drivers/hwmon
parent83af1bd81f7b7fb31a681b0c80790866f190d23a (diff)
hwmon: lis3: Release resources in case of failure
If lis3lv02d_init_device fails, HW resources were not released properly. In case of failure call release_resources if available. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Acked-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lis3lv02d_i2c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/lis3lv02d_i2c.c b/drivers/hwmon/lis3lv02d_i2c.c
index 0074809917a2..9f4bae07f719 100644
--- a/drivers/hwmon/lis3lv02d_i2c.c
+++ b/drivers/hwmon/lis3lv02d_i2c.c
@@ -160,7 +160,12 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
160 160
161 if (lis3_dev.reg_ctrl) 161 if (lis3_dev.reg_ctrl)
162 lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF); 162 lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
163
164 if (ret == 0)
165 return 0;
163fail: 166fail:
167 if (pdata && pdata->release_resources)
168 pdata->release_resources();
164 return ret; 169 return ret;
165} 170}
166 171