HID: do not try to compile PM code with CONFIG_PM unset

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 6:03 pm

Gitweb:     http://git.kernel.org/linus/0f6f1407e3e4a2cc4f602806d3c174473850f4da
Commit:     0f6f1407e3e4a2cc4f602806d3c174473850f4da
Parent:     0361a28d3f9a4315a100c7b37ba0b55cfe15fe07
Author:     Jiri Kosina <jkosina@suse.cz>
AuthorDate: Mon Jan 19 09:17:18 2009 +0100
Committer:  Jiri Kosina <jkosina@suse.cz>
CommitDate: Wed Mar 25 17:57:58 2009 +0100

    HID: do not try to compile PM code with CONFIG_PM unset
    
    Fixes this build breakage in case when CONFIG_PM is not set
    
    drivers/hid/usbhid/hid-core.c: In function 'hid_suspend':
    drivers/hid/usbhid/hid-core.c:1220: error: 'struct usb_device' has no member named 'auto_pm'
    drivers/hid/usbhid/hid-core.c:1245: error: 'struct usb_device' has no member named 'auto_pm'
    drivers/hid/usbhid/hid-core.c:1258: error: 'struct usb_device' has no member named 'auto_pm'
    
    by throwing both the hid_suspend() and hid_resume() away completely
    in such case, as they won't be used anyway.
    
    Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: Jiri Kosina <jkosina@suse.cz>
---
 drivers/hid/usbhid/hid-core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 625e7e8..d8799a1 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1210,6 +1210,7 @@ static void hid_cease_io(struct usbhid_device *usbhid)
 	flush_scheduled_work();
 }
 
+#ifdef CONFIG_PM
 static int hid_suspend(struct usb_interface *intf, pm_message_t message)
 {
 	struct hid_device *hid = usb_get_intfdata(intf);
@@ -1292,6 +1293,8 @@ static int hid_resume(struct usb_interface *intf)
 	return 0;
 }
 
+#endif /* CONFIG_PM */
+
 /* Treat USB reset pretty much the same as suspend/resume */
 static int hid_pre_reset(struct usb_interface *intf)
 {
@@ -1353,9 +1356,11 @@ static struct usb_driver hid_driver = {
 	.name =		"usbhid",
 	.probe =	hid_probe,
 	.disconnect =	hid_disconnect,
+#ifdef CONFIG_PM
 	.suspend =	hid_suspend,
 	.resume =	hid_resume,
 	.reset_resume =	hid_post_reset,
+#endif
 	.pre_reset =	hid_pre_reset,
 	.post_reset =	hid_post_reset,
 	.id_table =	hid_usb_ids,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
HID: do not try to compile PM code with CONFIG_PM unset, Linux Kernel Mailing ..., (Fri Apr 3, 6:03 pm)