Commit ac92f151 authored by Russell King's avatar Russell King

pcmcia: pxa2xx: update socket driver to use devm_clk_get() API

Update the pxa2xx socket driver to use the devm_clk_get() API so that
the cleanup paths are simplified.
Reviewed-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent e33e640a
...@@ -296,17 +296,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) ...@@ -296,17 +296,15 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
goto err0; goto err0;
} }
clk = clk_get(&dev->dev, NULL); clk = devm_clk_get(&dev->dev, NULL);
if (IS_ERR(clk)) if (IS_ERR(clk))
return -ENODEV; return -ENODEV;
pxa2xx_drv_pcmcia_ops(ops); pxa2xx_drv_pcmcia_ops(ops);
sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
if (!sinfo) { if (!sinfo)
clk_put(clk);
return -ENOMEM; return -ENOMEM;
}
sinfo->nskt = ops->nr; sinfo->nskt = ops->nr;
sinfo->clk = clk; sinfo->clk = clk;
...@@ -332,7 +330,6 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) ...@@ -332,7 +330,6 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
err1: err1:
while (--i >= 0) while (--i >= 0)
soc_pcmcia_remove_one(&sinfo->skt[i]); soc_pcmcia_remove_one(&sinfo->skt[i]);
clk_put(clk);
kfree(sinfo); kfree(sinfo);
err0: err0:
return ret; return ret;
...@@ -348,7 +345,6 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) ...@@ -348,7 +345,6 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
for (i = 0; i < sinfo->nskt; i++) for (i = 0; i < sinfo->nskt; i++)
soc_pcmcia_remove_one(&sinfo->skt[i]); soc_pcmcia_remove_one(&sinfo->skt[i]);
clk_put(sinfo->clk);
kfree(sinfo); kfree(sinfo);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment