提交 b11e7b3f 编写于 作者: S Samu Onkalo 提交者: Guenter Roeck

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: NSamu Onkalo <samu.p.onkalo@nokia.com>
Acked-by: NEric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: NGuenter Roeck <guenter.roeck@ericsson.com>
上级 83af1bd8
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册