* [RESEND PATCH v1] usb: dwc3: keystone: Simplify with dev_err_probe()
@ 2021-01-11 13:55 Andy Shevchenko
2021-01-11 14:05 ` Felipe Balbi
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-01-11 13:55 UTC (permalink / raw)
To: Felipe Balbi, linux-usb, Greg Kroah-Hartman; +Cc: Andy Shevchenko
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and the error value gets printed.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/usb/dwc3/dwc3-keystone.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-keystone.c b/drivers/usb/dwc3/dwc3-keystone.c
index 9a99253d5ba3..057056c0975e 100644
--- a/drivers/usb/dwc3/dwc3-keystone.c
+++ b/drivers/usb/dwc3/dwc3-keystone.c
@@ -99,13 +99,8 @@ static int kdwc3_probe(struct platform_device *pdev)
/* PSC dependency on AM65 needs SERDES0 to be powered before USB0 */
kdwc->usb3_phy = devm_phy_optional_get(dev, "usb3-phy");
- if (IS_ERR(kdwc->usb3_phy)) {
- error = PTR_ERR(kdwc->usb3_phy);
- if (error != -EPROBE_DEFER)
- dev_err(dev, "couldn't get usb3 phy: %d\n", error);
-
- return error;
- }
+ if (IS_ERR(kdwc->usb3_phy))
+ return dev_err_probe(dev, PTR_ERR(kdwc->usb3_phy), "couldn't get usb3 phy\n");
phy_pm_runtime_get_sync(kdwc->usb3_phy);
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND PATCH v1] usb: dwc3: keystone: Simplify with dev_err_probe()
2021-01-11 13:55 [RESEND PATCH v1] usb: dwc3: keystone: Simplify with dev_err_probe() Andy Shevchenko
@ 2021-01-11 14:05 ` Felipe Balbi
0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2021-01-11 14:05 UTC (permalink / raw)
To: Andy Shevchenko, linux-usb, Greg Kroah-Hartman; +Cc: Andy Shevchenko
[-- Attachment #1: Type: text/plain, Size: 327 bytes --]
Andy Shevchenko <andriy.shevchenko@linux.intel.com> writes:
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Felipe Balbi <balbi@kernel.org>
--
balbi
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 857 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-11 14:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-11 13:55 [RESEND PATCH v1] usb: dwc3: keystone: Simplify with dev_err_probe() Andy Shevchenko
2021-01-11 14:05 ` Felipe Balbi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.