OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
83af1bd
)
hwmon: lis3: Release resources in case of failure
author
Samu Onkalo
<samu.p.onkalo@nokia.com>
Fri, 22 Oct 2010 11:57:34 +0000
(07:57 -0400)
committer
Guenter Roeck
<guenter.roeck@ericsson.com>
Mon, 25 Oct 2010 21:44:59 +0000
(14:44 -0700)
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>
drivers/hwmon/lis3lv02d_i2c.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/lis3lv02d_i2c.c
b/drivers/hwmon/lis3lv02d_i2c.c
index
0074809
..
9f4bae0
100644
(file)
--- 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,
if (lis3_dev.reg_ctrl)
lis3_reg_ctrl(&lis3_dev, LIS3_REG_OFF);
+
+ if (ret == 0)
+ return 0;
fail:
+ if (pdata && pdata->release_resources)
+ pdata->release_resources();
return ret;
}