Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[firefly-linux-kernel-4.4.55.git] / drivers / mfd / max77693.c
index 4055bc2d36fb9ded8d0ef0aab01d65fe32f6aa7b..a1811cb50ec75fc7c1dffd02aca98f132d7e4810 100644 (file)
@@ -154,7 +154,7 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
 
        ret = max77693_irq_init(max77693);
        if (ret < 0)
-               goto err_mfd;
+               goto err_irq;
 
        pm_runtime_set_active(max77693->dev);
 
@@ -168,11 +168,11 @@ static int max77693_i2c_probe(struct i2c_client *i2c,
        return ret;
 
 err_mfd:
+       max77693_irq_exit(max77693);
+err_irq:
        i2c_unregister_device(max77693->muic);
        i2c_unregister_device(max77693->haptic);
 err_regmap:
-       kfree(max77693);
-
        return ret;
 }
 
@@ -181,6 +181,7 @@ static int max77693_i2c_remove(struct i2c_client *i2c)
        struct max77693_dev *max77693 = i2c_get_clientdata(i2c);
 
        mfd_remove_devices(max77693->dev);
+       max77693_irq_exit(max77693);
        i2c_unregister_device(max77693->muic);
        i2c_unregister_device(max77693->haptic);
 
@@ -213,7 +214,7 @@ static int max77693_resume(struct device *dev)
        return max77693_irq_resume(max77693);
 }
 
-const struct dev_pm_ops max77693_pm = {
+static const struct dev_pm_ops max77693_pm = {
        .suspend = max77693_suspend,
        .resume = max77693_resume,
 };