diff mbox series

[11/11] usb: dwc3: xilinx: simplify with dev_err_probe

Message ID 20240814-b4-cleanup-h-of-node-put-usb-v1-11-95481b9682bc@linaro.org
State Accepted
Commit e23593ee41fa4d2f76588dfe609b416c1d9710b8
Headers show
Series usb: dwc3: various cleanups | expand

Commit Message

Krzysztof Kozlowski Aug. 14, 2024, 10:35 a.m. UTC
Use dev_err_probe() to make the error paths a bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/usb/dwc3/dwc3-xilinx.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Thinh Nguyen Aug. 27, 2024, 1:45 a.m. UTC | #1
On Wed, Aug 14, 2024, Krzysztof Kozlowski wrote:
> Use dev_err_probe() to make the error paths a bit simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/usb/dwc3/dwc3-xilinx.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
> index b7613a106da6..eb535733ce91 100644
> --- a/drivers/usb/dwc3/dwc3-xilinx.c
> +++ b/drivers/usb/dwc3/dwc3-xilinx.c
> @@ -285,11 +285,8 @@ static int dwc3_xlnx_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	regs = devm_platform_ioremap_resource(pdev, 0);
> -	if (IS_ERR(regs)) {
> -		ret = PTR_ERR(regs);
> -		dev_err_probe(dev, ret, "failed to map registers\n");
> -		return ret;
> -	}
> +	if (IS_ERR(regs))
> +		return dev_err_probe(dev, PTR_ERR(regs), "failed to map registers\n");
>  
>  	match = of_match_node(dwc3_xlnx_of_match, pdev->dev.of_node);
>  
> 
> -- 
> 2.43.0
> 

Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
index b7613a106da6..eb535733ce91 100644
--- a/drivers/usb/dwc3/dwc3-xilinx.c
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -285,11 +285,8 @@  static int dwc3_xlnx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	regs = devm_platform_ioremap_resource(pdev, 0);
-	if (IS_ERR(regs)) {
-		ret = PTR_ERR(regs);
-		dev_err_probe(dev, ret, "failed to map registers\n");
-		return ret;
-	}
+	if (IS_ERR(regs))
+		return dev_err_probe(dev, PTR_ERR(regs), "failed to map registers\n");
 
 	match = of_match_node(dwc3_xlnx_of_match, pdev->dev.of_node);