Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271308
b: refs/heads/master
c: b4bee69
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Florian Tobias Schandinat committed Sep 5, 2011
1 parent 109a623 commit da75e8a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 53 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 91fba48d59666718e3d3e86964755b80d39cdbdd
refs/heads/master: b4bee692e5d5a3beb5b59ca7967c0a98e3efcc26
102 changes: 50 additions & 52 deletions trunk/drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,56 @@ static int sh_mobile_lcdc_notify(struct notifier_block *nb,
return NOTIFY_OK;
}

static int sh_mobile_lcdc_remove(struct platform_device *pdev);
static int sh_mobile_lcdc_remove(struct platform_device *pdev)
{
struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
struct fb_info *info;
int i;

fb_unregister_client(&priv->notifier);

for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
if (priv->ch[i].info && priv->ch[i].info->dev)
unregister_framebuffer(priv->ch[i].info);

sh_mobile_lcdc_stop(priv);

for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
info = priv->ch[i].info;

if (!info || !info->device)
continue;

if (priv->ch[i].sglist)
vfree(priv->ch[i].sglist);

if (info->screen_base)
dma_free_coherent(&pdev->dev, info->fix.smem_len,
info->screen_base,
priv->ch[i].dma_handle);
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
}

for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
if (priv->ch[i].bl)
sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
}

if (priv->dot_clk)
clk_put(priv->dot_clk);

if (priv->dev)
pm_runtime_disable(priv->dev);

if (priv->base)
iounmap(priv->base);

if (priv->irq)
free_irq(priv->irq, priv);
kfree(priv);
return 0;
}

static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
{
Expand Down Expand Up @@ -1691,57 +1740,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
return error;
}

static int sh_mobile_lcdc_remove(struct platform_device *pdev)
{
struct sh_mobile_lcdc_priv *priv = platform_get_drvdata(pdev);
struct fb_info *info;
int i;

fb_unregister_client(&priv->notifier);

for (i = 0; i < ARRAY_SIZE(priv->ch); i++)
if (priv->ch[i].info && priv->ch[i].info->dev)
unregister_framebuffer(priv->ch[i].info);

sh_mobile_lcdc_stop(priv);

for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
info = priv->ch[i].info;

if (!info || !info->device)
continue;

if (priv->ch[i].sglist)
vfree(priv->ch[i].sglist);

if (info->screen_base)
dma_free_coherent(&pdev->dev, info->fix.smem_len,
info->screen_base,
priv->ch[i].dma_handle);
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
}

for (i = 0; i < ARRAY_SIZE(priv->ch); i++) {
if (priv->ch[i].bl)
sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
}

if (priv->dot_clk)
clk_put(priv->dot_clk);

if (priv->dev)
pm_runtime_disable(priv->dev);

if (priv->base)
iounmap(priv->base);

if (priv->irq)
free_irq(priv->irq, priv);
kfree(priv);
return 0;
}

static struct platform_driver sh_mobile_lcdc_driver = {
.driver = {
.name = "sh_mobile_lcdc_fb",
Expand Down

0 comments on commit da75e8a

Please sign in to comment.