summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/max8998.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-10-22 02:31:49 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-10-29 00:30:39 +0200
commit7484552eb24e3c62ef55a4ff0133d8450adea206 (patch)
treee7dc6967a86eeb474165656deb322f9fcbcfd1b0 /drivers/mfd/max8998.c
parentmfd: Remove unneeded ret value checking for max8998 register updates (diff)
downloadlinux-7484552eb24e3c62ef55a4ff0133d8450adea206.tar.xz
linux-7484552eb24e3c62ef55a4ff0133d8450adea206.zip
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: Axel Lin <axel.lin@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--drivers/mfd/max8998.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c
index 06ddf741d4c7..bb9977bebe78 100644
--- a/drivers/mfd/max8998.c
+++ b/drivers/mfd/max8998.c
@@ -153,6 +153,8 @@ static int max8998_i2c_probe(struct i2c_client *i2c,
err:
mfd_remove_devices(max8998->dev);
+ max8998_irq_exit(max8998);
+ i2c_unregister_device(max8998->rtc);
kfree(max8998);
return ret;
}
@@ -162,6 +164,8 @@ static int max8998_i2c_remove(struct i2c_client *i2c)
struct max8998_dev *max8998 = i2c_get_clientdata(i2c);
mfd_remove_devices(max8998->dev);
+ max8998_irq_exit(max8998);
+ i2c_unregister_device(max8998->rtc);
kfree(max8998);
return 0;