--- zzzz-none-000/linux-3.10.107/drivers/pcmcia/pxa2xx_base.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/pcmcia/pxa2xx_base.c 2021-02-04 17:41:59.000000000 +0000 @@ -296,20 +296,18 @@ 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 @@ err1: while (--i >= 0) soc_pcmcia_remove_one(&sinfo->skt[i]); - clk_put(clk); - kfree(sinfo); + err0: return ret; } @@ -343,13 +340,9 @@ 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; } @@ -368,7 +361,6 @@ .remove = pxa2xx_drv_pcmcia_remove, .driver = { .name = "pxa2xx-pcmcia", - .owner = THIS_MODULE, .pm = &pxa2xx_drv_pcmcia_pm_ops, }, };