X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=arch%2Falpha%2Fkernel%2Frtc.c;h=1b1d5963ac550b6475a46c9159f42a363e4e0db8;hb=ac5eed2b41776b05cf03aac761d3bb5e64eea24c;hp=1376a28670482cf827eb8f482d4ff2254f2a39e4;hpb=1eb89893ecaae25b4e01a2efc3cfdfa07b1da3ab;p=linux-2.6-microblaze.git diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c index 1376a2867048..1b1d5963ac55 100644 --- a/arch/alpha/kernel/rtc.c +++ b/arch/alpha/kernel/rtc.c @@ -198,26 +198,24 @@ static const struct rtc_class_ops remote_rtc_ops = { static int __init alpha_rtc_init(void) { - const struct rtc_class_ops *ops; struct platform_device *pdev; struct rtc_device *rtc; - const char *name; init_rtc_epoch(); - name = "rtc-alpha"; - ops = &alpha_rtc_ops; -#ifdef HAVE_REMOTE_RTC - if (alpha_mv.rtc_boot_cpu_only) - ops = &remote_rtc_ops; -#endif - - pdev = platform_device_register_simple(name, -1, NULL, 0); - rtc = devm_rtc_device_register(&pdev->dev, name, ops, THIS_MODULE); + pdev = platform_device_register_simple("rtc-alpha", -1, NULL, 0); + rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc)) return PTR_ERR(rtc); platform_set_drvdata(pdev, rtc); - return 0; + rtc->ops = &alpha_rtc_ops; + +#ifdef HAVE_REMOTE_RTC + if (alpha_mv.rtc_boot_cpu_only) + rtc->ops = &remote_rtc_ops; +#endif + + return rtc_register_device(rtc); } device_initcall(alpha_rtc_init);