PM: for-mm: Fix compile failure in boot time suspend selftest
Subsystems (2)
PATCH 1/1 PM: for-mm: Fix compile failure in boot time suspend selftest
The following config revealed a compilation problem in the suspend self test program included in 2.6.26-rc5-mm2:
kernel/power/main.c: In function 'test_suspend':kernel/power/main.c:688: warning: passing argument 2 of 'class_find_device' from incompatible pointer type kernel/power/main.c:688: error: too few arguments to function 'class_find_device' make[2]: *** [kernel/power/main.o] Error 1
#
# Power management options
#CONFIG_PM=yCONFIG_PM_DEBUG=yCONFIG_PM_VERBOSE=yCONFIG_CAN_PM_TRACE=yCONFIG_PM_TRACE=yCONFIG_PM_TRACE_RTC=yCONFIG_PM_SLEEP=yCONFIG_SUSPEND=yCONFIG_PM_TEST_SUSPEND=yCONFIG_SUSPEND_FREEZER=y
# CONFIG_HIBERNATION is not set
Fix the compilation error by using NULL to tell class_find_device() that we're initiating an iteration rather than resuming a previously-initiated one.
---
Applies to 2.6.26-rc5-mm2
WARNING: Compiles (for me) but is otherwise untested. I'll be
booting with this soon when I start testing some other work that's not in 2.6.26-rc5-mm2.
kernel/power/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/power/main.c +1 -1
@@ -683,11 +683,11 @@ static int __init test_suspend(void)printk (warn_bad_state, pm_states[test_state]); goto done; }/* RTCs have initialized by now too ... can we use one? */ -class_find_device (rtc_class, &pony, has_wakealarm); +class_find_device (rtc_class,NULL , &pony, has_wakealarm);if (pony) rtc =rtc_class_open (pony);if (!rtc) {printk (warn_no_rtc); goto done;