diff mbox series

usb: xhci: Covert to update_device callback returning void

Message ID 20240628155103.3585-1-sensor1010@163.com (mailing list archive)
State New
Headers show
Series usb: xhci: Covert to update_device callback returning void | expand

Commit Message

Lizhe June 28, 2024, 3:51 p.m. UTC
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(-)
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 37eb37b0affa..63db4957d3af 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -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 ------------------------*/
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index ac95e7c89df5..c3fd1643ff1a 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -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. */