linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral
@ 2021-05-19 16:35 Jon Hunter
  2021-05-19 16:35 ` [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe() Jon Hunter
  2021-06-03  6:22 ` [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Felipe Balbi
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Hunter @ 2021-05-19 16:35 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Thierry Reding
  Cc: linux-usb, linux-tegra, Jon Hunter

The Tegra XUDC driver prints the following error when deferring probe
if the USB PHY is not found ...

 ERR KERN tegra-xudc 3550000.usb: failed to get usbphy-0: -517

Deferring probe can be normal and so update to driver to avoid printing
this error if probe is being deferred.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/usb/gadget/udc/tegra-xudc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index 2319c9737c2b..a62bf095954b 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -3520,8 +3520,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
 						&xudc->vbus_nb);
 			if (IS_ERR(xudc->usbphy[i])) {
 				err = PTR_ERR(xudc->usbphy[i]);
-				dev_err(xudc->dev, "failed to get usbphy-%d: %d\n",
-					i, err);
+				dev_err_probe(xudc->dev, err,
+					      "failed to get usbphy-%d\n", i);
 				goto clean_up;
 			}
 		} else if (!xudc->utmi_phy[i]) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe()
  2021-05-19 16:35 [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Jon Hunter
@ 2021-05-19 16:35 ` Jon Hunter
  2021-06-03  6:22   ` Felipe Balbi
  2021-06-03  6:22 ` [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Felipe Balbi
  1 sibling, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2021-05-19 16:35 UTC (permalink / raw)
  To: Felipe Balbi, Greg Kroah-Hartman, Thierry Reding
  Cc: linux-usb, linux-tegra, Jon Hunter

Rather than testing if the error code is -EPROBE_DEFER before printing
an error message, use dev_err_probe() instead to simplify the code.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/usb/gadget/udc/tegra-xudc.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c
index a62bf095954b..a4fd4ee6770f 100644
--- a/drivers/usb/gadget/udc/tegra-xudc.c
+++ b/drivers/usb/gadget/udc/tegra-xudc.c
@@ -3508,10 +3508,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
 		xudc->utmi_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
 		if (IS_ERR(xudc->utmi_phy[i])) {
 			err = PTR_ERR(xudc->utmi_phy[i]);
-			if (err != -EPROBE_DEFER)
-				dev_err(xudc->dev, "failed to get usb2-%d PHY: %d\n",
-					i, err);
-
+			dev_err_probe(xudc->dev, err,
+				      "failed to get usb2-%d PHY\n", i);
 			goto clean_up;
 		} else if (xudc->utmi_phy[i]) {
 			/* Get usb-phy, if utmi phy is available */
@@ -3538,10 +3536,8 @@ static int tegra_xudc_phy_get(struct tegra_xudc *xudc)
 		xudc->usb3_phy[i] = devm_phy_optional_get(xudc->dev, phy_name);
 		if (IS_ERR(xudc->usb3_phy[i])) {
 			err = PTR_ERR(xudc->usb3_phy[i]);
-			if (err != -EPROBE_DEFER)
-				dev_err(xudc->dev, "failed to get usb3-%d PHY: %d\n",
-					usb3, err);
-
+			dev_err_probe(xudc->dev, err,
+				      "failed to get usb3-%d PHY\n", usb3);
 			goto clean_up;
 		} else if (xudc->usb3_phy[i])
 			dev_dbg(xudc->dev, "usb3-%d PHY registered", usb3);
@@ -3781,9 +3777,7 @@ static int tegra_xudc_probe(struct platform_device *pdev)
 
 	err = devm_clk_bulk_get(&pdev->dev, xudc->soc->num_clks, xudc->clks);
 	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(xudc->dev, "failed to request clocks: %d\n", err);
-
+		dev_err_probe(xudc->dev, err, "failed to request clocks\n");
 		return err;
 	}
 
@@ -3798,9 +3792,7 @@ static int tegra_xudc_probe(struct platform_device *pdev)
 	err = devm_regulator_bulk_get(&pdev->dev, xudc->soc->num_supplies,
 				      xudc->supplies);
 	if (err) {
-		if (err != -EPROBE_DEFER)
-			dev_err(xudc->dev, "failed to request regulators: %d\n", err);
-
+		dev_err_probe(xudc->dev, err, "failed to request regulators\n");
 		return err;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral
  2021-05-19 16:35 [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Jon Hunter
  2021-05-19 16:35 ` [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe() Jon Hunter
@ 2021-06-03  6:22 ` Felipe Balbi
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:22 UTC (permalink / raw)
  To: Jon Hunter, Greg Kroah-Hartman, Thierry Reding
  Cc: linux-usb, linux-tegra, Jon Hunter

[-- Attachment #1: Type: text/plain, Size: 456 bytes --]

Jon Hunter <jonathanh@nvidia.com> writes:

> The Tegra XUDC driver prints the following error when deferring probe
> if the USB PHY is not found ...
>
>  ERR KERN tegra-xudc 3550000.usb: failed to get usbphy-0: -517
>
> Deferring probe can be normal and so update to driver to avoid printing
> this error if probe is being deferred.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe()
  2021-05-19 16:35 ` [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe() Jon Hunter
@ 2021-06-03  6:22   ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2021-06-03  6:22 UTC (permalink / raw)
  To: Jon Hunter, Greg Kroah-Hartman, Thierry Reding
  Cc: linux-usb, linux-tegra, Jon Hunter

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

Jon Hunter <jonathanh@nvidia.com> writes:

> Rather than testing if the error code is -EPROBE_DEFER before printing
> an error message, use dev_err_probe() instead to simplify the code.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>

Acked-by: Felipe Balbi <balbi@kernel.org>

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-03  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 16:35 [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Jon Hunter
2021-05-19 16:35 ` [PATCH 2/2] usb: gadget: tegra-xudc: Use dev_err_probe() Jon Hunter
2021-06-03  6:22   ` Felipe Balbi
2021-06-03  6:22 ` [PATCH 1/2] usb: gadget: tegra-xudc: Don't print error on probe deferral Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).