]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
mfd: Fix resource reclaim for max8998
authorAxel Lin <axel.lin@gmail.com>
Fri, 22 Oct 2010 00:31:49 +0000 (08:31 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 28 Oct 2010 22:30:39 +0000 (00:30 +0200)
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>
drivers/mfd/max8998.c

index 06ddf741d4c772affc9c3c7980597f75f92ce244..bb9977bebe782d10103a9235bd9e513bb7201f66 100644 (file)
@@ -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;