Comment 18 for bug 293484

Revision history for this message
In , shr (shr-redhat-bugs) wrote :

Yes, it's working

[root@HPDL360G5-1 ~]# uname -a
Linux HPDL360G5-1.lab.icst.org.tw 2.6.27.2 #1 SMP Wed Oct 22 16:39:56 CST 2008 x86_64 x86_64 x86_64 GNU/Linu

[root@HPDL360G5-1 ~]# dmesg | grep -i rtc
platform rtc_cmos: registered platform RTC device (no PNP device found)
rtc_cmos rtc_cmos: rtc core: registered rtc_cmos as rtc0
rtc0: alarms up to one day, hpet irqs

[root@HPDL360G5-1 ~]# ls -al /dev/rtc*
lrwxrwxrwx 1 root root 4 2008-10-23 00:49 /dev/rtc -> rtc0
crw-r--r-- 1 root root 254, 0 2008-10-23 00:49 /dev/rtc0

kernel 2.6.27.2

rtc.c line 216-
static struct platform_device rtc_device = {
        .name = "rtc_cmos",
        .id = -1,
        .resource = rtc_resources,
        .num_resources = ARRAY_SIZE(rtc_resources),
};

static __init int add_rtc_cmos(void)
{
#ifdef CONFIG_PNP
        static const char *ids[] __initconst =
                { "PNP0b00", "PNP0b01", "PNP0b02", };
        struct pnp_dev *dev;
        struct pnp_id *id;
        int i;

        pnp_for_each_dev(dev) {
                for (id = dev->id; id; id = id->next) {
                        for (i = 0; i < ARRAY_SIZE(ids); i++) {
                                if (compare_pnp_id(id, ids[i]) != 0)
                                        return 0;
                        }
                }
        }
#endif

        platform_device_register(&rtc_device);
        dev_info(&rtc_device.dev,
                "registered platform RTC device (no PNP device found)\n");
        return 0;
}
device_initcall(add_rtc_cmos);

rtc-cmos.c line 1021-
static struct platform_driver cmos_platform_driver = {
        .remove = __exit_p(cmos_platform_remove),
        .shutdown = cmos_platform_shutdown,
        .driver = {
                .name = (char *) driver_name,
                .suspend = cmos_suspend,
                .resume = cmos_resume,
        }
};

static int __init cmos_init(void)
{
        int retval = 0;

#ifdef CONFIG_PNP
        pnp_register_driver(&cmos_pnp_driver);
#endif

        if (!cmos_rtc.dev)
                retval = platform_driver_probe(&cmos_platform_driver,
                                                cmos_platform_probe);

        if (retval == 0)
                return 0;

#ifdef CONFIG_PNP
        pnp_unregister_driver(&cmos_pnp_driver);
#endif
        return retval;
}
module_init(cmos_init);

static void __exit cmos_exit(void)
{
#ifdef CONFIG_PNP
        pnp_unregister_driver(&cmos_pnp_driver);
#endif
}
module_exit(cmos_exit);

MODULE_AUTHOR("David Brownell");
MODULE_DESCRIPTION("Driver for PC-style 'CMOS' RTCs");
MODULE_LICENSE("GPL");