aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2012-12-15 17:50:54 -0500
committerSimon Horman <horms+renesas@verge.net.au>2013-01-24 19:24:22 -0500
commit40ee6fce7a0d3a2b2a1f2a14900af98a49a9ff40 (patch)
tree0ea1f8e145f087ee9b48213e76e1088293a14688
parent4aeacd5bd5c354c1b36bfe3d5d72806ecd9605a0 (diff)
sh-pfc: Split platform device and platform driver registration
Move platform driver registration to a static postcore initcall. This prepares the move of platform device registration to arch code. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--drivers/sh/pfc/core.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/sh/pfc/core.c b/drivers/sh/pfc/core.c
index 1bb38e8b36ad..cd8f09dcea95 100644
--- a/drivers/sh/pfc/core.c
+++ b/drivers/sh/pfc/core.c
@@ -573,19 +573,16 @@ static struct platform_device sh_pfc_device = {
573 573
574int __init register_sh_pfc(struct sh_pfc_platform_data *pdata) 574int __init register_sh_pfc(struct sh_pfc_platform_data *pdata)
575{ 575{
576 int rc;
577
578 sh_pfc_device.dev.platform_data = pdata; 576 sh_pfc_device.dev.platform_data = pdata;
579 577
580 rc = platform_driver_register(&sh_pfc_driver); 578 return platform_device_register(&sh_pfc_device);
581 if (likely(!rc)) { 579}
582 rc = platform_device_register(&sh_pfc_device);
583 if (unlikely(rc))
584 platform_driver_unregister(&sh_pfc_driver);
585 }
586 580
587 return rc; 581static int __init sh_pfc_init(void)
582{
583 return platform_driver_register(&sh_pfc_driver);
588} 584}
585postcore_initcall(sh_pfc_init);
589 586
590static void __exit sh_pfc_exit(void) 587static void __exit sh_pfc_exit(void)
591{ 588{