Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (29 commits) [POWERPC] Fix rheap alignment problem [POWERPC] Use check_legacy_ioport() for ISAPnP [POWERPC] Avoid NULL pointer in gpio1_interrupt [POWERPC] Enable generic rtc hook for the MPC8349 mITX [POWERPC] Add powerpc get/set_rtc_time interface to new generic rtc class [POWERPC] Create a "wrapper" script and use it in arch/powerpc/boot [POWERPC] fix spin lock nesting in hvc_iseries [POWERPC] EEH failure to mark pci slot as frozen. [POWERPC] update powerpc defconfig files after libata kconfig breakage [POWERPC] enable sysrq in pmac32_defconfig [POWERPC] UPIO_TSI cleanup [POWERPC] rewrite mkprep and mkbugboot in sane C [POWERPC] maple/pci iomem annotations [POWERPC] powerpc oprofile __user annotations [POWERPC] cell spufs iomem annotations [POWERPC] NULL noise removal: spufs [POWERPC] ppc math-emu needs -fno-builtin-fabs for math.c and fabs.c [POWERPC] update mpc8349_itx_defconfig and remove some debug settings [POWERPC] Always call cede in pseries dedicated idle loop [POWERPC] Fix loop logic in irq_alloc_virt() ...
This commit is contained in:
@@ -1041,6 +1041,48 @@ void __init time_init(void)
|
||||
set_dec(tb_ticks_per_jiffy);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_RTC_CLASS
|
||||
static int set_rtc_class_time(struct rtc_time *tm)
|
||||
{
|
||||
int err;
|
||||
struct class_device *class_dev =
|
||||
rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
|
||||
|
||||
if (class_dev == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
err = rtc_set_time(class_dev, tm);
|
||||
|
||||
rtc_class_close(class_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void get_rtc_class_time(struct rtc_time *tm)
|
||||
{
|
||||
int err;
|
||||
struct class_device *class_dev =
|
||||
rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
|
||||
|
||||
if (class_dev == NULL)
|
||||
return;
|
||||
|
||||
err = rtc_read_time(class_dev, tm);
|
||||
|
||||
rtc_class_close(class_dev);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int __init rtc_class_hookup(void)
|
||||
{
|
||||
ppc_md.get_rtc_time = get_rtc_class_time;
|
||||
ppc_md.set_rtc_time = set_rtc_class_time;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_RTC_CLASS */
|
||||
|
||||
|
||||
#define FEBRUARY 2
|
||||
#define STARTOFTIME 1970
|
||||
|
Reference in New Issue
Block a user