From: Magnus Damm <[email protected]>

Cleanup the use of platform_set_drvdata() to reduce code size

Signed-off-by: Shinya Kuribayashi <[email protected]>
Signed-off-by: Magnus Damm <[email protected]>
---

 drivers/clocksource/sh_cmt.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- 0003/drivers/clocksource/sh_cmt.c
+++ work/drivers/clocksource/sh_cmt.c   2012-12-14 12:54:59.000000000 +0900
@@ -649,8 +649,6 @@ static int sh_cmt_setup(struct sh_cmt_pr
                goto err0;
        }
 
-       platform_set_drvdata(pdev, p);
-
        res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0);
        if (!res) {
                dev_err(&p->pdev->dev, "failed to get I/O memory\n");
@@ -718,6 +716,8 @@ static int sh_cmt_setup(struct sh_cmt_pr
                goto err2;
        }
 
+       platform_set_drvdata(pdev, p);
+
        return 0;
 err2:
        clk_put(p->clk);
@@ -753,7 +753,6 @@ static int __devinit sh_cmt_probe(struct
        ret = sh_cmt_setup(p, pdev);
        if (ret) {
                kfree(p);
-               platform_set_drvdata(pdev, NULL);
                pm_runtime_idle(&pdev->dev);
                return ret;
        }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to