From: Keir Fraser Date: Thu, 8 Oct 2009 07:53:36 +0000 (+0100) Subject: usbfront: fix compile error and disable PM feature X-Git-Tag: xen-3.4.2~4 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=05fb2ccdba82b3778670be48ef37fed9670edcb0;p=legacy%2Flinux-2.6.18-xen.git usbfront: fix compile error and disable PM feature Fix the compilation error of usbfront, and disable bus suspend/resume by default. Signed-off-by: Noboru Iwamatsu --- diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index a153b5a4..5d405ba8 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -248,6 +248,13 @@ config XEN_USB_FRONTEND_HCD_STATS help Count the transferred urb status and the RING_FULL occurrence. +config XEN_USB_FRONTEND_HCD_PM + bool "HCD suspend/resume support (DO NOT USE)" + depends on XEN_USB_FRONTEND + default n + help + Experimental bus suspend/resume feature support. + config XEN_GRANT_DEV tristate "User-space granted page access driver" default XEN_PRIVILEGED_GUEST diff --git a/drivers/xen/usbfront/Makefile b/drivers/xen/usbfront/Makefile index ad60d46b..034ba965 100644 --- a/drivers/xen/usbfront/Makefile +++ b/drivers/xen/usbfront/Makefile @@ -5,3 +5,7 @@ xen-hcd-y := usbfront-hcd.o xenbus.o ifeq ($(CONFIG_XEN_USB_FRONTEND_HCD_STATS),y) EXTRA_CFLAGS += -DXENHCD_STATS endif + +ifeq ($(CONFIG_XEN_USB_FRONTEND_HCD_PM),y) +EXTRA_CFLAGS += -DXENHCD_PM +endif diff --git a/drivers/xen/usbfront/usbfront-hcd.c b/drivers/xen/usbfront/usbfront-hcd.c index 54bda268..f7f9ed9a 100644 --- a/drivers/xen/usbfront/usbfront-hcd.c +++ b/drivers/xen/usbfront/usbfront-hcd.c @@ -195,10 +195,12 @@ struct hc_driver xen_usb20_hc_driver = { /* root hub operations */ .hub_status_data = xenhcd_hub_status_data, .hub_control = xenhcd_hub_control, +#ifdef XENHCD_PM #ifdef CONFIG_PM .bus_suspend = xenhcd_bus_suspend, .bus_resume = xenhcd_bus_resume, #endif +#endif }; struct hc_driver xen_usb11_hc_driver = { @@ -220,8 +222,10 @@ struct hc_driver xen_usb11_hc_driver = { /* root hub operations */ .hub_status_data = xenhcd_hub_status_data, .hub_control = xenhcd_hub_control, +#ifdef XENHCD_PM #ifdef CONFIG_PM .bus_suspend = xenhcd_bus_suspend, .bus_resume = xenhcd_bus_resume, #endif +#endif }; diff --git a/drivers/xen/usbfront/usbfront-hub.c b/drivers/xen/usbfront/usbfront-hub.c index 1c54f1a3..3c4ae3e4 100644 --- a/drivers/xen/usbfront/usbfront-hub.c +++ b/drivers/xen/usbfront/usbfront-hub.c @@ -207,6 +207,7 @@ void rhport_reset(struct usbfront_info *info, int portnum) info->ports[port].timeout = jiffies + msecs_to_jiffies(10); } +#ifdef XENHCD_PM #ifdef CONFIG_PM static int xenhcd_bus_suspend(struct usb_hcd *hcd) { @@ -217,9 +218,9 @@ static int xenhcd_bus_suspend(struct usb_hcd *hcd) ports = info->rh_numports; spin_lock_irq(&info->lock); - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &info->flags)) + if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) ret = -ESHUTDOWN; - else if (!info->dead) { + else { /* suspend any active ports*/ for (i = 1; i <= ports; i++) rhport_suspend(info, i); @@ -240,9 +241,9 @@ static int xenhcd_bus_resume(struct usb_hcd *hcd) ports = info->rh_numports; spin_lock_irq(&info->lock); - if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &info->flags)) + if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) ret = -ESHUTDOWN; - else if (!info->dead) { + else { /* resume any suspended ports*/ for (i = 1; i <= ports; i++) rhport_resume(info, i); @@ -252,6 +253,7 @@ static int xenhcd_bus_resume(struct usb_hcd *hcd) return ret; } #endif +#endif static void xenhcd_hub_descriptor(struct usbfront_info *info, struct usb_hub_descriptor *desc)