Skip to content

Commit

Permalink
hwmon: lis3: Release resources in case of failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samu Onkalo authored and Guenter Roeck committed Oct 25, 2010
1 parent 83af1bd commit b11e7b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hwmon/lis3lv02d_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b11e7b3

Please sign in to comment.