aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRob Herring (Arm) <robh@kernel.org>2025-01-09 11:07:47 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-11 17:02:30 +0100
commit7d3934884babcfb1252c4296e0060c7a0749a429 (patch)
tree2bc505ccb5172a30b38680dc3a7929795ddcb755
parentusb: dwc3: st: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() (diff)
downloadwireguard-linux-7d3934884babcfb1252c4296e0060c7a0749a429.tar.xz
wireguard-linux-7d3934884babcfb1252c4296e0060c7a0749a429.zip
usb: dwc3: omap: Fix devm_regulator_get_optional() error handling
Commit 533561a8aad5 ("usb: dwc3: omap: Use devm_regulator_get_optional()") assumed NULL was returned, but devm_regulator_get_optional() returns -ENODEV rather than NULL like other *_get_optional() functions. Fixes: 533561a8aad5 ("usb: dwc3: omap: Use devm_regulator_get_optional()") Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20250109170748.3852439-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/usb/dwc3/dwc3-omap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c
index 9b1d10ac33c1..fe74d11bb629 100644
--- a/drivers/usb/dwc3/dwc3-omap.c
+++ b/drivers/usb/dwc3/dwc3-omap.c
@@ -484,8 +484,11 @@ static int dwc3_omap_probe(struct platform_device *pdev)
return PTR_ERR(base);
vbus_reg = devm_regulator_get_optional(dev, "vbus");
- if (IS_ERR(vbus_reg))
- return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
+ if (IS_ERR(vbus_reg)) {
+ if (PTR_ERR(vbus_reg) != -ENODEV)
+ return dev_err_probe(dev, PTR_ERR(vbus_reg), "vbus init failed\n");
+ vbus_reg = NULL;
+ }
omap->dev = dev;
omap->irq = irq;