diff mbox series

[1/1] usb: chipidea: ci_hdrc_imx: use dev_err_probe

Message ID 20230130094151.95174-1-alexander.stein@ew.tq-group.com (mailing list archive)
State Accepted
Commit 3a1bd0494352bd89ec50ee595ababfe180f2d63e
Headers show
Series [1/1] usb: chipidea: ci_hdrc_imx: use dev_err_probe | expand

Commit Message

Alexander Stein Jan. 30, 2023, 9:41 a.m. UTC
Add error message if finding USB PHY fails or is deferred.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
 drivers/usb/chipidea/ci_hdrc_imx.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Peter Chen Feb. 10, 2023, 8:51 a.m. UTC | #1
On 23-01-30 10:41:51, Alexander Stein wrote:
> Add error message if finding USB PHY fails or is deferred.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Acked-by: Peter Chen <peter.chen@kernel.org>

Peter
> ---
>  drivers/usb/chipidea/ci_hdrc_imx.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 0dc482542d85..2eeccf4ec9d6 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -413,15 +413,19 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)
>  	data->phy = devm_usb_get_phy_by_phandle(dev, "fsl,usbphy", 0);
>  	if (IS_ERR(data->phy)) {
>  		ret = PTR_ERR(data->phy);
> -		if (ret != -ENODEV)
> +		if (ret != -ENODEV) {
> +			dev_err_probe(dev, ret, "Failed to parse fsl,usbphy\n");
>  			goto err_clk;
> +		}
>  		data->phy = devm_usb_get_phy_by_phandle(dev, "phys", 0);
>  		if (IS_ERR(data->phy)) {
>  			ret = PTR_ERR(data->phy);
> -			if (ret == -ENODEV)
> +			if (ret == -ENODEV) {
>  				data->phy = NULL;
> -			else
> +			} else {
> +				dev_err_probe(dev, ret, "Failed to parse phys\n");
>  				goto err_clk;
> +			}
>  		}
>  	}
>  
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
index 0dc482542d85..2eeccf4ec9d6 100644
--- a/drivers/usb/chipidea/ci_hdrc_imx.c
+++ b/drivers/usb/chipidea/ci_hdrc_imx.c
@@ -413,15 +413,19 @@  static int ci_hdrc_imx_probe(struct platform_device *pdev)
 	data->phy = devm_usb_get_phy_by_phandle(dev, "fsl,usbphy", 0);
 	if (IS_ERR(data->phy)) {
 		ret = PTR_ERR(data->phy);
-		if (ret != -ENODEV)
+		if (ret != -ENODEV) {
+			dev_err_probe(dev, ret, "Failed to parse fsl,usbphy\n");
 			goto err_clk;
+		}
 		data->phy = devm_usb_get_phy_by_phandle(dev, "phys", 0);
 		if (IS_ERR(data->phy)) {
 			ret = PTR_ERR(data->phy);
-			if (ret == -ENODEV)
+			if (ret == -ENODEV) {
 				data->phy = NULL;
-			else
+			} else {
+				dev_err_probe(dev, ret, "Failed to parse phys\n");
 				goto err_clk;
+			}
 		}
 	}