Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294224
b: refs/heads/master
c: 4774c12
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart committed Mar 12, 2012
1 parent efba9fc commit aa36434
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 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: 217e9c4353aa86f0c7eeb4c275bca73ea8b53be1
refs/heads/master: 4774c12aacafc0b8be81b1d159be5a761889e2d7
34 changes: 16 additions & 18 deletions trunk/drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
int clock_source,
struct sh_mobile_lcdc_priv *priv)
{
struct clk *clk;
char *str;

switch (clock_source) {
Expand All @@ -210,21 +211,16 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev,
return -EINVAL;
}

if (str) {
priv->dot_clk = clk_get(&pdev->dev, str);
if (IS_ERR(priv->dot_clk)) {
dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
return PTR_ERR(priv->dot_clk);
}
if (str == NULL)
return 0;

clk = clk_get(&pdev->dev, str);
if (IS_ERR(clk)) {
dev_err(&pdev->dev, "cannot get dot clock %s\n", str);
return PTR_ERR(clk);
}

/* Runtime PM support involves two step for this driver:
* 1) Enable Runtime PM
* 2) Force Runtime PM Resume since hardware is accessed from probe()
*/
priv->dev = &pdev->dev;
pm_runtime_enable(priv->dev);
pm_runtime_resume(priv->dev);
priv->dot_clk = clk;
return 0;
}

Expand Down Expand Up @@ -1513,11 +1509,10 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev)
sh_mobile_lcdc_bl_remove(priv->ch[i].bl);
}

if (priv->dot_clk)
if (priv->dot_clk) {
pm_runtime_disable(&pdev->dev);
clk_put(priv->dot_clk);

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

if (priv->base)
iounmap(priv->base);
Expand Down Expand Up @@ -1739,6 +1734,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
return -ENOMEM;
}

priv->dev = &pdev->dev;
priv->meram_dev = pdata->meram_dev;
platform_set_drvdata(pdev, priv);

error = request_irq(i, sh_mobile_lcdc_irq, 0,
Expand Down Expand Up @@ -1804,7 +1801,8 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev)
goto err1;
}

priv->meram_dev = pdata->meram_dev;
/* Enable runtime PM. */
pm_runtime_enable(&pdev->dev);

for (i = 0; i < num_channels; i++) {
struct sh_mobile_lcdc_chan *ch = priv->ch + i;
Expand Down

0 comments on commit aa36434

Please sign in to comment.