diff options
author | Jingoo Han <jg1.han@samsung.com> | 2012-08-02 02:59:05 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2012-08-23 09:11:24 -0400 |
commit | 776213493fe96de7fa4b53755ebc3dcd570a8ab9 (patch) | |
tree | 2be6c7e936505c5d5774b390760964afcedf6485 /drivers/video/s3c-fb.c | |
parent | 4c4ceee0de69616f98240cbe3f5a4ed6d1973c63 (diff) |
video: s3c-fb: 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.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/s3c-fb.c')
-rw-r--r-- | drivers/video/s3c-fb.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c index 69bf9d07c237..6c951264357a 100644 --- a/drivers/video/s3c-fb.c +++ b/drivers/video/s3c-fb.c | |||
@@ -1398,17 +1398,16 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev) | |||
1398 | 1398 | ||
1399 | spin_lock_init(&sfb->slock); | 1399 | spin_lock_init(&sfb->slock); |
1400 | 1400 | ||
1401 | sfb->bus_clk = clk_get(dev, "lcd"); | 1401 | sfb->bus_clk = devm_clk_get(dev, "lcd"); |
1402 | if (IS_ERR(sfb->bus_clk)) { | 1402 | if (IS_ERR(sfb->bus_clk)) { |
1403 | dev_err(dev, "failed to get bus clock\n"); | 1403 | dev_err(dev, "failed to get bus clock\n"); |
1404 | ret = PTR_ERR(sfb->bus_clk); | 1404 | return PTR_ERR(sfb->bus_clk); |
1405 | goto err_sfb; | ||
1406 | } | 1405 | } |
1407 | 1406 | ||
1408 | clk_enable(sfb->bus_clk); | 1407 | clk_enable(sfb->bus_clk); |
1409 | 1408 | ||
1410 | if (!sfb->variant.has_clksel) { | 1409 | if (!sfb->variant.has_clksel) { |
1411 | sfb->lcd_clk = clk_get(dev, "sclk_fimd"); | 1410 | sfb->lcd_clk = devm_clk_get(dev, "sclk_fimd"); |
1412 | if (IS_ERR(sfb->lcd_clk)) { | 1411 | if (IS_ERR(sfb->lcd_clk)) { |
1413 | dev_err(dev, "failed to get lcd clock\n"); | 1412 | dev_err(dev, "failed to get lcd clock\n"); |
1414 | ret = PTR_ERR(sfb->lcd_clk); | 1413 | ret = PTR_ERR(sfb->lcd_clk); |
@@ -1421,12 +1420,6 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev) | |||
1421 | pm_runtime_enable(sfb->dev); | 1420 | pm_runtime_enable(sfb->dev); |
1422 | 1421 | ||
1423 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1422 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1424 | if (!res) { | ||
1425 | dev_err(dev, "failed to find registers\n"); | ||
1426 | ret = -ENOENT; | ||
1427 | goto err_lcd_clk; | ||
1428 | } | ||
1429 | |||
1430 | sfb->regs = devm_request_and_ioremap(dev, res); | 1423 | sfb->regs = devm_request_and_ioremap(dev, res); |
1431 | if (!sfb->regs) { | 1424 | if (!sfb->regs) { |
1432 | dev_err(dev, "failed to map registers\n"); | 1425 | dev_err(dev, "failed to map registers\n"); |
@@ -1510,16 +1503,12 @@ err_pm_runtime: | |||
1510 | err_lcd_clk: | 1503 | err_lcd_clk: |
1511 | pm_runtime_disable(sfb->dev); | 1504 | pm_runtime_disable(sfb->dev); |
1512 | 1505 | ||
1513 | if (!sfb->variant.has_clksel) { | 1506 | if (!sfb->variant.has_clksel) |
1514 | clk_disable(sfb->lcd_clk); | 1507 | clk_disable(sfb->lcd_clk); |
1515 | clk_put(sfb->lcd_clk); | ||
1516 | } | ||
1517 | 1508 | ||
1518 | err_bus_clk: | 1509 | err_bus_clk: |
1519 | clk_disable(sfb->bus_clk); | 1510 | clk_disable(sfb->bus_clk); |
1520 | clk_put(sfb->bus_clk); | ||
1521 | 1511 | ||
1522 | err_sfb: | ||
1523 | return ret; | 1512 | return ret; |
1524 | } | 1513 | } |
1525 | 1514 | ||
@@ -1541,13 +1530,10 @@ static int __devexit s3c_fb_remove(struct platform_device *pdev) | |||
1541 | if (sfb->windows[win]) | 1530 | if (sfb->windows[win]) |
1542 | s3c_fb_release_win(sfb, sfb->windows[win]); | 1531 | s3c_fb_release_win(sfb, sfb->windows[win]); |
1543 | 1532 | ||
1544 | if (!sfb->variant.has_clksel) { | 1533 | if (!sfb->variant.has_clksel) |
1545 | clk_disable(sfb->lcd_clk); | 1534 | clk_disable(sfb->lcd_clk); |
1546 | clk_put(sfb->lcd_clk); | ||
1547 | } | ||
1548 | 1535 | ||
1549 | clk_disable(sfb->bus_clk); | 1536 | clk_disable(sfb->bus_clk); |
1550 | clk_put(sfb->bus_clk); | ||
1551 | 1537 | ||
1552 | pm_runtime_put_sync(sfb->dev); | 1538 | pm_runtime_put_sync(sfb->dev); |
1553 | pm_runtime_disable(sfb->dev); | 1539 | pm_runtime_disable(sfb->dev); |