Commit 7484552e authored by Axel Lin's avatar Axel Lin Committed by Samuel Ortiz

mfd: Fix resource reclaim for max8998

Properly free irq and unregister max8998->rtc device in
max8998_i2c_probe() error path and max8998_i2c_remove().
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 25d95071
...@@ -153,6 +153,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c, ...@@ -153,6 +153,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
err: err:
mfd_remove_devices(max8998->dev); mfd_remove_devices(max8998->dev);
max8998_irq_exit(max8998);
i2c_unregister_device(max8998->rtc);
kfree(max8998); kfree(max8998);
return ret; return ret;
} }
...@@ -162,6 +164,8 @@ static int max8998_i2c_remove(struct i2c_client *i2c) ...@@ -162,6 +164,8 @@ static int max8998_i2c_remove(struct i2c_client *i2c)
struct max8998_dev *max8998 = i2c_get_clientdata(i2c); struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
mfd_remove_devices(max8998->dev); mfd_remove_devices(max8998->dev);
max8998_irq_exit(max8998);
i2c_unregister_device(max8998->rtc);
kfree(max8998); kfree(max8998);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment