m68k: Hook up rtc-generic
m68k has been a long time user of the generic RTC abstraction, so hook up rtc-generic: - Create the "rtc-generic" platform device if mach_hwclk is set, - Add checks for mach_hwclk, in anticipation of RTC chip drivers being moved to drivers/rtc/. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
This commit is contained in:
committed by
Kyle McMartin
parent
3afe6d0462
commit
2ceb3ad705
@@ -18,6 +18,7 @@
|
||||
#include <linux/string.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/rtc.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
#include <asm/machdep.h>
|
||||
#include <asm/io.h>
|
||||
@@ -159,3 +160,20 @@ int do_settimeofday(struct timespec *tv)
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(do_settimeofday);
|
||||
|
||||
|
||||
static int __init rtc_init(void)
|
||||
{
|
||||
struct platform_device *pdev;
|
||||
|
||||
if (!mach_hwclk)
|
||||
return -ENODEV;
|
||||
|
||||
pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
|
||||
if (IS_ERR(pdev))
|
||||
return PTR_ERR(pdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
module_init(rtc_init);
|
||||
|
Reference in New Issue
Block a user