ARM: at91/tclib: prefer using of devm_* functions
Signed-off-by: Gaël PORTAY <gael.portay@gmail.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
This commit is contained in:
parent
2626063f86
commit
8495497f92
@ -150,17 +150,15 @@ static int __init tc_probe(struct platform_device *pdev)
|
|||||||
if (irq < 0)
|
if (irq < 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
tc = kzalloc(sizeof(struct atmel_tc), GFP_KERNEL);
|
tc = devm_kzalloc(&pdev->dev, sizeof(struct atmel_tc), GFP_KERNEL);
|
||||||
if (!tc)
|
if (!tc)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
tc->pdev = pdev;
|
tc->pdev = pdev;
|
||||||
|
|
||||||
clk = clk_get(&pdev->dev, "t0_clk");
|
clk = devm_clk_get(&pdev->dev, "t0_clk");
|
||||||
if (IS_ERR(clk)) {
|
if (IS_ERR(clk))
|
||||||
kfree(tc);
|
return PTR_ERR(clk);
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now take SoC information if available */
|
/* Now take SoC information if available */
|
||||||
if (pdev->dev.of_node) {
|
if (pdev->dev.of_node) {
|
||||||
@ -171,10 +169,10 @@ static int __init tc_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tc->clk[0] = clk;
|
tc->clk[0] = clk;
|
||||||
tc->clk[1] = clk_get(&pdev->dev, "t1_clk");
|
tc->clk[1] = devm_clk_get(&pdev->dev, "t1_clk");
|
||||||
if (IS_ERR(tc->clk[1]))
|
if (IS_ERR(tc->clk[1]))
|
||||||
tc->clk[1] = clk;
|
tc->clk[1] = clk;
|
||||||
tc->clk[2] = clk_get(&pdev->dev, "t2_clk");
|
tc->clk[2] = devm_clk_get(&pdev->dev, "t2_clk");
|
||||||
if (IS_ERR(tc->clk[2]))
|
if (IS_ERR(tc->clk[2]))
|
||||||
tc->clk[2] = clk;
|
tc->clk[2] = clk;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user