diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-08-31 07:00:57 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-09-05 12:37:14 -0400 |
commit | b4bee692e5d5a3beb5b59ca7967c0a98e3efcc26 (patch) | |
tree | d10732d743bf1e4343225f85ab963f3bf4929a46 /drivers/video/sh_mobile_lcdcfb.c | |
parent | 91fba48d59666718e3d3e86964755b80d39cdbdd (diff) |
fbdev: sh_mobile_lcdc: Avoid forward declarations
Reorder probe/remove functions to avoid forward declarations.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 102 |
1 files changed, 50 insertions, 52 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index b6da1d644619..366315bedc0d 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -1434,7 +1434,56 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb, | |||
1434 | return NOTIFY_OK; | 1434 | return NOTIFY_OK; |
1435 | } | 1435 | } |
1436 | 1436 | ||
1437 | static int sh_mobile_lcdc_remove(struct platform_device *pdev); | 1437 | static int sh_mobile_lcdc_remove(struct platform_device *pdev) |
1438 | { | ||
1439 | struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); | ||
1440 | struct fb_info *info; | ||
1441 | int i; | ||
1442 | |||
1443 | fb_unregister_client(&priv->notifier); | ||
1444 | |||
1445 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | ||
1446 | if (priv->ch[i].info && priv->ch[i].info->dev) | ||
1447 | unregister_framebuffer(priv->ch[i].info); | ||
1448 | |||
1449 | sh_mobile_lcdc_stop(priv); | ||
1450 | |||
1451 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | ||
1452 | info = priv->ch[i].info; | ||
1453 | |||
1454 | if (!info || !info->device) | ||
1455 | continue; | ||
1456 | |||
1457 | if (priv->ch[i].sglist) | ||
1458 | vfree(priv->ch[i].sglist); | ||
1459 | |||
1460 | if (info->screen_base) | ||
1461 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | ||
1462 | info->screen_base, | ||
1463 | priv->ch[i].dma_handle); | ||
1464 | fb_dealloc_cmap(&info->cmap); | ||
1465 | framebuffer_release(info); | ||
1466 | } | ||
1467 | |||
1468 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | ||
1469 | if (priv->ch[i].bl) | ||
1470 | sh_mobile_lcdc_bl_remove(priv->ch[i].bl); | ||
1471 | } | ||
1472 | |||
1473 | if (priv->dot_clk) | ||
1474 | clk_put(priv->dot_clk); | ||
1475 | |||
1476 | if (priv->dev) | ||
1477 | pm_runtime_disable(priv->dev); | ||
1478 | |||
1479 | if (priv->base) | ||
1480 | iounmap(priv->base); | ||
1481 | |||
1482 | if (priv->irq) | ||
1483 | free_irq(priv->irq, priv); | ||
1484 | kfree(priv); | ||
1485 | return 0; | ||
1486 | } | ||
1438 | 1487 | ||
1439 | static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | 1488 | static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) |
1440 | { | 1489 | { |
@@ -1691,57 +1740,6 @@ err1: | |||
1691 | return error; | 1740 | return error; |
1692 | } | 1741 | } |
1693 | 1742 | ||
1694 | static int sh_mobile_lcdc_remove(struct platform_device *pdev) | ||
1695 | { | ||
1696 | struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev); | ||
1697 | struct fb_info *info; | ||
1698 | int i; | ||
1699 | |||
1700 | fb_unregister_client(&priv->notifier); | ||
1701 | |||
1702 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | ||
1703 | if (priv->ch[i].info && priv->ch[i].info->dev) | ||
1704 | unregister_framebuffer(priv->ch[i].info); | ||
1705 | |||
1706 | sh_mobile_lcdc_stop(priv); | ||
1707 | |||
1708 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | ||
1709 | info = priv->ch[i].info; | ||
1710 | |||
1711 | if (!info || !info->device) | ||
1712 | continue; | ||
1713 | |||
1714 | if (priv->ch[i].sglist) | ||
1715 | vfree(priv->ch[i].sglist); | ||
1716 | |||
1717 | if (info->screen_base) | ||
1718 | dma_free_coherent(&pdev->dev, info->fix.smem_len, | ||
1719 | info->screen_base, | ||
1720 | priv->ch[i].dma_handle); | ||
1721 | fb_dealloc_cmap(&info->cmap); | ||
1722 | framebuffer_release(info); | ||
1723 | } | ||
1724 | |||
1725 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) { | ||
1726 | if (priv->ch[i].bl) | ||
1727 | sh_mobile_lcdc_bl_remove(priv->ch[i].bl); | ||
1728 | } | ||
1729 | |||
1730 | if (priv->dot_clk) | ||
1731 | clk_put(priv->dot_clk); | ||
1732 | |||
1733 | if (priv->dev) | ||
1734 | pm_runtime_disable(priv->dev); | ||
1735 | |||
1736 | if (priv->base) | ||
1737 | iounmap(priv->base); | ||
1738 | |||
1739 | if (priv->irq) | ||
1740 | free_irq(priv->irq, priv); | ||
1741 | kfree(priv); | ||
1742 | return 0; | ||
1743 | } | ||
1744 | |||
1745 | static struct platform_driver sh_mobile_lcdc_driver = { | 1743 | static struct platform_driver sh_mobile_lcdc_driver = { |
1746 | .driver = { | 1744 | .driver = { |
1747 | .name = "sh_mobile_lcdc_fb", | 1745 | .name = "sh_mobile_lcdc_fb", |