ata: pata_arasam_cf: Use devm_clk_get
This patch introduces the use of managed resource function devm_clk_get instead of clk_get and removes corresponding call to clk_put in the remove function. To be compatible with the change various gotos are replaced with direct returns, and unneeded label is dropped. Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
38755e897e
commit
d6e9b704d9
|
@ -834,7 +834,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
acdev->clk = clk_get(&pdev->dev, NULL);
|
acdev->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(acdev->clk)) {
|
if (IS_ERR(acdev->clk)) {
|
||||||
dev_warn(&pdev->dev, "Clock not found\n");
|
dev_warn(&pdev->dev, "Clock not found\n");
|
||||||
return PTR_ERR(acdev->clk);
|
return PTR_ERR(acdev->clk);
|
||||||
|
@ -843,9 +843,8 @@ static int arasan_cf_probe(struct platform_device *pdev)
|
||||||
/* allocate host */
|
/* allocate host */
|
||||||
host = ata_host_alloc(&pdev->dev, 1);
|
host = ata_host_alloc(&pdev->dev, 1);
|
||||||
if (!host) {
|
if (!host) {
|
||||||
ret = -ENOMEM;
|
|
||||||
dev_warn(&pdev->dev, "alloc host fail\n");
|
dev_warn(&pdev->dev, "alloc host fail\n");
|
||||||
goto free_clk;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
ap = host->ports[0];
|
ap = host->ports[0];
|
||||||
|
@ -894,7 +893,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ret = cf_init(acdev);
|
ret = cf_init(acdev);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto free_clk;
|
return ret;
|
||||||
|
|
||||||
cf_card_detect(acdev, 0);
|
cf_card_detect(acdev, 0);
|
||||||
|
|
||||||
|
@ -904,8 +903,7 @@ static int arasan_cf_probe(struct platform_device *pdev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
cf_exit(acdev);
|
cf_exit(acdev);
|
||||||
free_clk:
|
|
||||||
clk_put(acdev->clk);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,7 +914,6 @@ static int arasan_cf_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
ata_host_detach(host);
|
ata_host_detach(host);
|
||||||
cf_exit(acdev);
|
cf_exit(acdev);
|
||||||
clk_put(acdev->clk);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue