These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / pcmcia / pxa2xx_base.c
index 984a8ff..483f919 100644 (file)
@@ -296,20 +296,18 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
                goto err0;
        }
 
-       clk = clk_get(&dev->dev, NULL);
+       clk = devm_clk_get(&dev->dev, NULL);
        if (IS_ERR(clk))
                return -ENODEV;
 
        pxa2xx_drv_pcmcia_ops(ops);
 
-       sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
-       if (!sinfo) {
-               clk_put(clk);
+       sinfo = devm_kzalloc(&dev->dev, SKT_DEV_INFO_SIZE(ops->nr),
+                            GFP_KERNEL);
+       if (!sinfo)
                return -ENOMEM;
-       }
 
        sinfo->nskt = ops->nr;
-       sinfo->clk = clk;
 
        /* Initialize processor specific parameters */
        for (i = 0; i < ops->nr; i++) {
@@ -332,8 +330,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
 err1:
        while (--i >= 0)
                soc_pcmcia_remove_one(&sinfo->skt[i]);
-       clk_put(clk);
-       kfree(sinfo);
+
 err0:
        return ret;
 }
@@ -343,13 +340,9 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
        struct skt_dev_info *sinfo = platform_get_drvdata(dev);
        int i;
 
-       platform_set_drvdata(dev, NULL);
-
        for (i = 0; i < sinfo->nskt; i++)
                soc_pcmcia_remove_one(&sinfo->skt[i]);
 
-       clk_put(sinfo->clk);
-       kfree(sinfo);
        return 0;
 }