From: Lizhe <sensor1010@163.com>
To: mathias.nyman@intel.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
Lizhe <sensor1010@163.com>
Subject: [PATCH] usb: xhci: Covert to update_device callback returning void
Date: Fri, 28 Jun 2024 08:51:02 -0700 [thread overview]
Message-ID: <20240628155103.3585-1-sensor1010@163.com> (raw)
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 --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. */
--
2.17.1
reply other threads:[~2024-06-28 15:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240628155103.3585-1-sensor1010@163.com \
--to=sensor1010@163.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mathias.nyman@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®