driver-core: constify data for class_find_device()
[deliverable/linux.git] / kernel / power / suspend_test.c
index 25596e450ac723d7a9409cb304784224f5fe3990..9b2a1d58558da81bfa31137a4b075214761f7a81 100644 (file)
@@ -112,7 +112,7 @@ static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)
        rtc_set_alarm(rtc, &alm);
 }
 
-static int __init has_wakealarm(struct device *dev, void *name_ptr)
+static int __init has_wakealarm(struct device *dev, const void *data)
 {
        struct rtc_device *candidate = to_rtc_device(dev);
 
@@ -121,7 +121,6 @@ static int __init has_wakealarm(struct device *dev, void *name_ptr)
        if (!device_may_wakeup(candidate->dev.parent))
                return 0;
 
-       *(const char **)name_ptr = dev_name(dev);
        return 1;
 }
 
@@ -159,8 +158,8 @@ static int __init test_suspend(void)
        static char             warn_no_rtc[] __initdata =
                KERN_WARNING "PM: no wakealarm-capable RTC driver is ready\n";
 
-       char                    *pony = NULL;
        struct rtc_device       *rtc = NULL;
+       struct device           *dev;
 
        /* PM is initialized by now; is that state testable? */
        if (test_state == PM_SUSPEND_ON)
@@ -171,9 +170,9 @@ static int __init test_suspend(void)
        }
 
        /* RTCs have initialized by now too ... can we use one? */
-       class_find_device(rtc_class, NULL, &pony, has_wakealarm);
-       if (pony)
-               rtc = rtc_class_open(pony);
+       dev = class_find_device(rtc_class, NULL, NULL, has_wakealarm);
+       if (dev)
+               rtc = rtc_class_open(dev_name(dev));
        if (!rtc) {
                printk(warn_no_rtc);
                goto done;
This page took 0.025511 seconds and 5 git commands to generate.