]> git.karo-electronics.de Git - linux-beck.git/commitdiff
clocksource: Deprecate clock string across the SH drivers.
authorPaul Mundt <lethal@linux-sh.org>
Mon, 29 Mar 2010 07:55:43 +0000 (16:55 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 29 Mar 2010 07:55:43 +0000 (16:55 +0900)
We want to get rid of the clock string from platform data entirely,
depending on the clkdev-based clock lookup to do the right thing for us
instead.

This converts all of the SH drivers to request their associated function
clocks directly, and if there is no match for that then we fall back on
the legacy lookup while warning about it. After all of the outstanding
CPUs have been converted to clkdev lookups the clock string will be
killed off completely.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
drivers/clocksource/sh_cmt.c
drivers/clocksource/sh_mtu2.c
drivers/clocksource/sh_tmu.c

index a1d38117138863b7314c65ae41ee337bfc7ef36b..c5f66171a713ff39481a536251ebcef582baa663 100644 (file)
@@ -608,11 +608,15 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
        p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
 
        /* get hold of clock */
-       p->clk = clk_get(&p->pdev->dev, cfg->clk);
+       p->clk = clk_get(&p->pdev->dev, "cmt_fck");
        if (IS_ERR(p->clk)) {
-               dev_err(&p->pdev->dev, "cannot get clock\n");
-               ret = PTR_ERR(p->clk);
-               goto err1;
+               dev_warn(&p->pdev->dev, "using deprecated clock lookup\n");
+               p->clk = clk_get(&p->pdev->dev, cfg->clk);
+               if (IS_ERR(p->clk)) {
+                       dev_err(&p->pdev->dev, "cannot get clock\n");
+                       ret = PTR_ERR(p->clk);
+                       goto err1;
+               }
        }
 
        if (resource_size(res) == 6) {
index 8ce355572d1665352778e72a3ff5cbaf86e4bcab..b11882e0f1bd6ca595704a0c5adc3884abf5e921 100644 (file)
@@ -283,11 +283,15 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev)
        p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
 
        /* get hold of clock */
-       p->clk = clk_get(&p->pdev->dev, cfg->clk);
+       p->clk = clk_get(&p->pdev->dev, "mtu2_fck");
        if (IS_ERR(p->clk)) {
-               dev_err(&p->pdev->dev, "cannot get clock\n");
-               ret = PTR_ERR(p->clk);
-               goto err1;
+               dev_warn(&p->pdev->dev, "using deprecated clock lookup\n");
+               p->clk = clk_get(&p->pdev->dev, cfg->clk);
+               if (IS_ERR(p->clk)) {
+                       dev_err(&p->pdev->dev, "cannot get clock\n");
+                       ret = PTR_ERR(p->clk);
+                       goto err1;
+               }
        }
 
        return sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev),
index 34239453ebafb3ae580afdaa3522c95e25696cd5..6b62283c1abab83d9d9ed936ea101d9a53ff0c81 100644 (file)
@@ -387,11 +387,15 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev)
        p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
 
        /* get hold of clock */
-       p->clk = clk_get(&p->pdev->dev, cfg->clk);
+       p->clk = clk_get(&p->pdev->dev, "tmu_fck");
        if (IS_ERR(p->clk)) {
-               dev_err(&p->pdev->dev, "cannot get clock\n");
-               ret = PTR_ERR(p->clk);
-               goto err1;
+               dev_warn(&p->pdev->dev, "using deprecated clock lookup\n");
+               p->clk = clk_get(&p->pdev->dev, cfg->clk);
+               if (IS_ERR(p->clk)) {
+                       dev_err(&p->pdev->dev, "cannot get clock\n");
+                       ret = PTR_ERR(p->clk);
+                       goto err1;
+               }
        }
 
        return sh_tmu_register(p, (char *)dev_name(&p->pdev->dev),