From: Laurent Pinchart Date: Sat, 15 Dec 2012 22:50:54 +0000 (+0100) Subject: sh-pfc: Split platform device and platform driver registration X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=40ee6fce7a0d3a2b2a1f2a14900af98a49a9ff40;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Paul Mundt Acked-by: Linus Walleij Signed-off-by: Simon Horman --- 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 = { int __init register_sh_pfc(struct sh_pfc_platform_data *pdata) { - int rc; - sh_pfc_device.dev.platform_data = pdata; - rc = platform_driver_register(&sh_pfc_driver); - if (likely(!rc)) { - rc = platform_device_register(&sh_pfc_device); - if (unlikely(rc)) - platform_driver_unregister(&sh_pfc_driver); - } + return platform_device_register(&sh_pfc_device); +} - return rc; +static int __init sh_pfc_init(void) +{ + return platform_driver_register(&sh_pfc_driver); } +postcore_initcall(sh_pfc_init); static void __exit sh_pfc_exit(void) {