Merge tag 'mmc-updates-for-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / drivers / mfd / ab8500-gpadc.c
index 13f7866de46eb21a4cdf0363f0386d315f8171dd..7623e91238287b4d04f6b5d28e994fd0e478117b 100644 (file)
@@ -886,12 +886,6 @@ static int ab8500_gpadc_runtime_resume(struct device *dev)
        return ret;
 }
 
-static int ab8500_gpadc_runtime_idle(struct device *dev)
-{
-       pm_runtime_suspend(dev);
-       return 0;
-}
-
 static int ab8500_gpadc_suspend(struct device *dev)
 {
        struct ab8500_gpadc *gpadc = dev_get_drvdata(dev);
@@ -925,7 +919,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev)
        int ret = 0;
        struct ab8500_gpadc *gpadc;
 
-       gpadc = kzalloc(sizeof(struct ab8500_gpadc), GFP_KERNEL);
+       gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL);
        if (!gpadc) {
                dev_err(&pdev->dev, "Error: No memory\n");
                return -ENOMEM;
@@ -1005,8 +999,6 @@ fail_irq:
        free_irq(gpadc->irq_sw, gpadc);
        free_irq(gpadc->irq_hw, gpadc);
 fail:
-       kfree(gpadc);
-       gpadc = NULL;
        return ret;
 }
 
@@ -1031,15 +1023,13 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
 
        pm_runtime_put_noidle(gpadc->dev);
 
-       kfree(gpadc);
-       gpadc = NULL;
        return 0;
 }
 
 static const struct dev_pm_ops ab8500_gpadc_pm_ops = {
        SET_RUNTIME_PM_OPS(ab8500_gpadc_runtime_suspend,
                           ab8500_gpadc_runtime_resume,
-                          ab8500_gpadc_runtime_idle)
+                          NULL)
        SET_SYSTEM_SLEEP_PM_OPS(ab8500_gpadc_suspend,
                                ab8500_gpadc_resume)