diff options
author | Sangjung Woo <sangjung.woo@samsung.com> | 2013-10-03 10:04:27 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-10-09 05:35:43 -0400 |
commit | 4d26ec5ddf93e7e133e36fd0454b54a3938f7d3c (patch) | |
tree | 3809976149eacfc1c206fa7d85510107e7fcf0bb | |
parent | 55be31089212898537c13fcf7ddb689f04868b4b (diff) |
fbdev: sh_mobile_hdmi: Use devm_kzalloc()
Use devm_kzalloc() instead of kzalloc() in order to be free
automatically. This makes cleanup paths more simple.
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/sh_mobile_hdmi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/video/sh_mobile_hdmi.c b/drivers/video/sh_mobile_hdmi.c index 45417fa9749b..5e2845b9f3a8 100644 --- a/drivers/video/sh_mobile_hdmi.c +++ b/drivers/video/sh_mobile_hdmi.c | |||
@@ -1290,7 +1290,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) | |||
1290 | } | 1290 | } |
1291 | } | 1291 | } |
1292 | 1292 | ||
1293 | hdmi = kzalloc(sizeof(*hdmi), GFP_KERNEL); | 1293 | hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); |
1294 | if (!hdmi) { | 1294 | if (!hdmi) { |
1295 | dev_err(&pdev->dev, "Cannot allocate device data\n"); | 1295 | dev_err(&pdev->dev, "Cannot allocate device data\n"); |
1296 | return -ENOMEM; | 1296 | return -ENOMEM; |
@@ -1304,7 +1304,7 @@ static int __init sh_hdmi_probe(struct platform_device *pdev) | |||
1304 | if (IS_ERR(hdmi->hdmi_clk)) { | 1304 | if (IS_ERR(hdmi->hdmi_clk)) { |
1305 | ret = PTR_ERR(hdmi->hdmi_clk); | 1305 | ret = PTR_ERR(hdmi->hdmi_clk); |
1306 | dev_err(&pdev->dev, "Unable to get clock: %d\n", ret); | 1306 | dev_err(&pdev->dev, "Unable to get clock: %d\n", ret); |
1307 | goto egetclk; | 1307 | return ret; |
1308 | } | 1308 | } |
1309 | 1309 | ||
1310 | /* select register access functions */ | 1310 | /* select register access functions */ |
@@ -1407,8 +1407,6 @@ ereqreg: | |||
1407 | clk_disable(hdmi->hdmi_clk); | 1407 | clk_disable(hdmi->hdmi_clk); |
1408 | erate: | 1408 | erate: |
1409 | clk_put(hdmi->hdmi_clk); | 1409 | clk_put(hdmi->hdmi_clk); |
1410 | egetclk: | ||
1411 | kfree(hdmi); | ||
1412 | 1410 | ||
1413 | return ret; | 1411 | return ret; |
1414 | } | 1412 | } |
@@ -1433,7 +1431,6 @@ static int __exit sh_hdmi_remove(struct platform_device *pdev) | |||
1433 | iounmap(hdmi->htop1); | 1431 | iounmap(hdmi->htop1); |
1434 | iounmap(hdmi->base); | 1432 | iounmap(hdmi->base); |
1435 | release_mem_region(res->start, resource_size(res)); | 1433 | release_mem_region(res->start, resource_size(res)); |
1436 | kfree(hdmi); | ||
1437 | 1434 | ||
1438 | return 0; | 1435 | return 0; |
1439 | } | 1436 | } |