Skip to content

Commit

Permalink
HID: do not try to compile PM code with CONFIG_PM unset
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Kosina committed Mar 25, 2009
1 parent 0361a28 commit 0f6f140
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hid/usbhid/hid-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0f6f140

Please sign in to comment.