* [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports()
@ 2024-01-31 7:10 Dan Carpenter
2024-02-08 23:57 ` Thinh Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2024-01-31 7:10 UTC (permalink / raw)
To: Ran Wang
Cc: Thinh Nguyen, Greg Kroah-Hartman, Peter Chen, Frank Li,
linux-usb, linux-kernel, kernel-janitors
The ioremap() function doesn't return error pointers, it returns NULL on
error. Update the check.
Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/usb/dwc3/host.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index ae189b7a4f8b..4e6239d3a0ac 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)
/* xhci regs is not mapped yet, do it temperary here */
if (dwc->xhci_resources[0].start) {
xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
- if (IS_ERR(xhci_regs)) {
+ if (!xhci_regs) {
dev_err(dwc->dev, "Failed to ioremap xhci_regs\n");
return;
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports()
2024-01-31 7:10 [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports() Dan Carpenter
@ 2024-02-08 23:57 ` Thinh Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Thinh Nguyen @ 2024-02-08 23:57 UTC (permalink / raw)
To: Dan Carpenter
Cc: Ran Wang, Thinh Nguyen, Greg Kroah-Hartman, Peter Chen, Frank Li,
linux-usb, linux-kernel, kernel-janitors
On Wed, Jan 31, 2024, Dan Carpenter wrote:
> The ioremap() function doesn't return error pointers, it returns NULL on
> error. Update the check.
>
> Fixes: 2d2a3349521d ("usb: dwc3: Add workaround for host mode VBUS glitch when boot")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/usb/dwc3/host.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index ae189b7a4f8b..4e6239d3a0ac 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -35,7 +35,7 @@ static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc)
> /* xhci regs is not mapped yet, do it temperary here */
> if (dwc->xhci_resources[0].start) {
> xhci_regs = ioremap(dwc->xhci_resources[0].start, DWC3_XHCI_REGS_END);
> - if (IS_ERR(xhci_regs)) {
> + if (!xhci_regs) {
> dev_err(dwc->dev, "Failed to ioremap xhci_regs\n");
> return;
> }
> --
> 2.43.0
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Thinh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-08 23:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31 7:10 [PATCH] usb: dwc3: Fix an IS_ERR() vs NULL check in dwc3_power_off_all_roothub_ports() Dan Carpenter
2024-02-08 23:57 ` Thinh Nguyen
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®