diff mbox series

phy: stm32: adopt dev_err_probe for regulators

Message ID 1635172265-26219-1-git-send-email-fabrice.gasnier@foss.st.com (mailing list archive)
State New, archived
Headers show
Series phy: stm32: adopt dev_err_probe for regulators | expand

Commit Message

Fabrice Gasnier Oct. 25, 2021, 2:31 p.m. UTC
Change stm32-usbphyc driver to use dev_err_probe(), to benefit of
devices_deferred debugfs in case of probe deferral.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

Comments

Amelie Delaunay Oct. 26, 2021, 3:50 p.m. UTC | #1
Hi Fabrice,

Thanks for your patch.

On 10/25/21 4:31 PM, Fabrice Gasnier wrote:
> Change stm32-usbphyc driver to use dev_err_probe(), to benefit of
> devices_deferred debugfs in case of probe deferral.
>  > Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

Reviewed-by: Amelie Delaunay <amelie.delaunay@foss.st.com>

> ---
>   drivers/phy/st/phy-stm32-usbphyc.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
> index 7df6a63..115be0e 100644
> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> @@ -672,17 +672,15 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
>   
>   	usbphyc->vdda1v1 = devm_regulator_get(dev, "vdda1v1");
>   	if (IS_ERR(usbphyc->vdda1v1)) {
> -		ret = PTR_ERR(usbphyc->vdda1v1);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get vdda1v1 supply: %d\n", ret);
> +		ret = dev_err_probe(dev, PTR_ERR(usbphyc->vdda1v1),
> +				    "failed to get vdda1v1 supply\n");
>   		goto clk_disable;
>   	}
>   
>   	usbphyc->vdda1v8 = devm_regulator_get(dev, "vdda1v8");
>   	if (IS_ERR(usbphyc->vdda1v8)) {
> -		ret = PTR_ERR(usbphyc->vdda1v8);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get vdda1v8 supply: %d\n", ret);
> +		ret = dev_err_probe(dev, PTR_ERR(usbphyc->vdda1v8),
> +				    "failed to get vdda1v8 supply\n");
>   		goto clk_disable;
>   	}
>   
>
Vinod Koul Nov. 23, 2021, 5:19 a.m. UTC | #2
On 25-10-21, 16:31, Fabrice Gasnier wrote:
> Change stm32-usbphyc driver to use dev_err_probe(), to benefit of
> devices_deferred debugfs in case of probe deferral.

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index 7df6a63..115be0e 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -672,17 +672,15 @@  static int stm32_usbphyc_probe(struct platform_device *pdev)
 
 	usbphyc->vdda1v1 = devm_regulator_get(dev, "vdda1v1");
 	if (IS_ERR(usbphyc->vdda1v1)) {
-		ret = PTR_ERR(usbphyc->vdda1v1);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get vdda1v1 supply: %d\n", ret);
+		ret = dev_err_probe(dev, PTR_ERR(usbphyc->vdda1v1),
+				    "failed to get vdda1v1 supply\n");
 		goto clk_disable;
 	}
 
 	usbphyc->vdda1v8 = devm_regulator_get(dev, "vdda1v8");
 	if (IS_ERR(usbphyc->vdda1v8)) {
-		ret = PTR_ERR(usbphyc->vdda1v8);
-		if (ret != -EPROBE_DEFER)
-			dev_err(dev, "failed to get vdda1v8 supply: %d\n", ret);
+		ret = dev_err_probe(dev, PTR_ERR(usbphyc->vdda1v8),
+				    "failed to get vdda1v8 supply\n");
 		goto clk_disable;
 	}