ata: pata_samsung_cf: Use devm_clk_get()
PATCH 1/1 ata: pata_samsung_cf: Use devm_clk_get()
The devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_clk_get() for these functions. These make the code smaller and a bit simpler.
Signed-off-by Jingoo Han <[email protected]>
--- drivers/ata/pata_samsung_cf.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/ata/pata_samsung_cf.c +1 -3
@@ -512,7 +512,7 @@ static int __init pata_s3c_probe(struct platform_device *pdev)return -ENOMEM ; } - info->clk =clk_get (&pdev->dev,"cfcon" ); + info->clk =devm_clk_get (&pdev->dev,"cfcon" );if (IS_ERR (info->clk)) {dev_err (dev,"failed to get access to cf controller clock\n" ); ret =PTR_ERR (info->clk);
@@ -589,7 +589,6 @@ static int __init pata_s3c_probe(struct platform_device *pdev) stop_clk:clk_disable (info->clk); -clk_put (info->clk);return ret; }
@@ -601,7 +600,6 @@ static int __exit pata_s3c_remove(struct platform_device *pdev)ata_host_detach (host);clk_disable (info->clk); -clk_put (info->clk);return 0 ; }
Signature · 1 line
1.7.2.5
Hello.
Quoted 2 lines · Jingoo Han
The
devm_functions allocate memory that is released when a driver detaches.
They don't do only that.
Quoted 1 line
This patch uses
devm_clk_get()for these functions.
Which doesn't allocate any memory.
Quoted 3 lines
These make the code smaller and a bit simpler.
Signed-off-by Jingoo Han <[email protected]>
MBR, Sergei