@@ -4507,19 +4507,19 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
return 0;
}
-static int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
+static void xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
{
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
struct xhci_port *port;
u32 capability;
if (hcd->speed >= HCD_USB3 || !udev->lpm_capable || !xhci->hw_lpm_support)
- return 0;
+ return;
/* we only support lpm for non-hub device connected to root hub yet */
if (!udev->parent || udev->parent->parent ||
udev->descriptor.bDeviceClass == USB_CLASS_HUB)
- return 0;
+ return;
port = xhci->usb2_rhub.ports[udev->portnum - 1];
capability = port->port_cap->protocol_caps;
@@ -4531,8 +4531,6 @@ static int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
if (capability & XHCI_BLC)
udev->usb2_hw_lpm_besl_capable = 1;
}
-
- return 0;
}
/*---------------------- USB 3.0 Link PM functions ------------------------*/
@@ -386,7 +386,7 @@ struct hc_driver {
/* Notifies the HCD after a device is connected and its
* address is set
*/
- int (*update_device)(struct usb_hcd *, struct usb_device *);
+ void (*update_device)(struct usb_hcd *, struct usb_device *);
int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int);
/* USB 3.0 Link Power Management */
/* Returns the USB3 hub-encoded value for the U1/U2 timeout. */
the returned value is ignored, and to improve this situation, it is proposed to modify the return type of the xhci_update_device() callback function to void. Signed-off-by: Lizhe <sensor1010@163.com> --- drivers/usb/host/xhci.c | 8 +++----- include/linux/usb/hcd.h | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-)