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>
This commit is contained in:
Laurent Pinchart 2012-12-15 23:50:54 +01:00 committed by Simon Horman
parent 4aeacd5bd5
commit 40ee6fce7a
1 changed files with 7 additions and 10 deletions

View File

@ -573,20 +573,17 @@ 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 rc;
return platform_device_register(&sh_pfc_device);
}
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)
{
platform_driver_unregister(&sh_pfc_driver);