diff options
author | Magnus Damm <damm@opensource.se> | 2012-12-14 00:53:51 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-03-12 13:24:36 -0400 |
commit | adccc69e7ad1815ce79b073830b244a803776bbd (patch) | |
tree | 92a5563ad0f50f3c65d2fd49efbafe6a639104a8 /drivers/clocksource | |
parent | 1b56b96b663d135305c3c47755fbdde3dc0ef720 (diff) |
clocksource: sh_cmt: Consolidate platform_set_drvdata() call
Cleanup the use of platform_set_drvdata() to reduce code size
Signed-off-by: Shinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Acked-by: John Stultz <john.stultz@linaro.org>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r-- | drivers/clocksource/sh_cmt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 94fd3abd6434..a2f8023a846b 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c | |||
@@ -688,8 +688,6 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev) | |||
688 | goto err0; | 688 | goto err0; |
689 | } | 689 | } |
690 | 690 | ||
691 | platform_set_drvdata(pdev, p); | ||
692 | |||
693 | res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0); | 691 | res = platform_get_resource(p->pdev, IORESOURCE_MEM, 0); |
694 | if (!res) { | 692 | if (!res) { |
695 | dev_err(&p->pdev->dev, "failed to get I/O memory\n"); | 693 | dev_err(&p->pdev->dev, "failed to get I/O memory\n"); |
@@ -757,6 +755,8 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev) | |||
757 | goto err2; | 755 | goto err2; |
758 | } | 756 | } |
759 | 757 | ||
758 | platform_set_drvdata(pdev, p); | ||
759 | |||
760 | return 0; | 760 | return 0; |
761 | err2: | 761 | err2: |
762 | clk_put(p->clk); | 762 | clk_put(p->clk); |
@@ -792,7 +792,6 @@ static int sh_cmt_probe(struct platform_device *pdev) | |||
792 | ret = sh_cmt_setup(p, pdev); | 792 | ret = sh_cmt_setup(p, pdev); |
793 | if (ret) { | 793 | if (ret) { |
794 | kfree(p); | 794 | kfree(p); |
795 | platform_set_drvdata(pdev, NULL); | ||
796 | pm_runtime_idle(&pdev->dev); | 795 | pm_runtime_idle(&pdev->dev); |
797 | return ret; | 796 | return ret; |
798 | } | 797 | } |