aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/usbhid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-01-19 03:17:18 -0500
committerJiri Kosina <jkosina@suse.cz>2009-03-25 12:57:58 -0400
commit0f6f1407e3e4a2cc4f602806d3c174473850f4da (patch)
tree540b031bcb6bfc3e10d43b924ec1a5260aff39ae /drivers/hid/usbhid
parent0361a28d3f9a4315a100c7b37ba0b55cfe15fe07 (diff)
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>
Diffstat (limited to 'drivers/hid/usbhid')
-rw-r--r--drivers/hid/usbhid/hid-core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 625e7e8eb37..d8799a18a42 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)
1210 flush_scheduled_work(); 1210 flush_scheduled_work();
1211} 1211}
1212 1212
1213#ifdef CONFIG_PM
1213static int hid_suspend(struct usb_interface *intf, pm_message_t message) 1214static int hid_suspend(struct usb_interface *intf, pm_message_t message)
1214{ 1215{
1215 struct hid_device *hid = usb_get_intfdata(intf); 1216 struct hid_device *hid = usb_get_intfdata(intf);
@@ -1292,6 +1293,8 @@ static int hid_resume(struct usb_interface *intf)
1292 return 0; 1293 return 0;
1293} 1294}
1294 1295
1296#endif /* CONFIG_PM */
1297
1295/* Treat USB reset pretty much the same as suspend/resume */ 1298/* Treat USB reset pretty much the same as suspend/resume */
1296static int hid_pre_reset(struct usb_interface *intf) 1299static int hid_pre_reset(struct usb_interface *intf)
1297{ 1300{
@@ -1353,9 +1356,11 @@ static struct usb_driver hid_driver = {
1353 .name = "usbhid", 1356 .name = "usbhid",
1354 .probe = hid_probe, 1357 .probe = hid_probe,
1355 .disconnect = hid_disconnect, 1358 .disconnect = hid_disconnect,
1359#ifdef CONFIG_PM
1356 .suspend = hid_suspend, 1360 .suspend = hid_suspend,
1357 .resume = hid_resume, 1361 .resume = hid_resume,
1358 .reset_resume = hid_post_reset, 1362 .reset_resume = hid_post_reset,
1363#endif
1359 .pre_reset = hid_pre_reset, 1364 .pre_reset = hid_pre_reset,
1360 .post_reset = hid_post_reset, 1365 .post_reset = hid_post_reset,
1361 .id_table = hid_usb_ids, 1366 .id_table = hid_usb_ids,