diff mbox series

[03/11] usb: dwc3: st: simplify pdev->dev usage

Message ID 20240814-b4-cleanup-h-of-node-put-usb-v1-3-95481b9682bc@linaro.org (mailing list archive)
State New
Headers show
Series usb: dwc3: various cleanups | expand

Commit Message

Krzysztof Kozlowski Aug. 14, 2024, 10:35 a.m. UTC
The probe() function already stores '&pdev->dev' in local 'dev'
variable.

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

Comments

Patrice CHOTARD Aug. 14, 2024, 3:45 p.m. UTC | #1
On 8/14/24 12:35, Krzysztof Kozlowski wrote:
> The probe() function already stores '&pdev->dev' in local 'dev'
> variable.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/usb/dwc3/dwc3-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> index 7a0b1821768a..2841021f3557 100644
> --- a/drivers/usb/dwc3/dwc3-st.c
> +++ b/drivers/usb/dwc3/dwc3-st.c
> @@ -225,13 +225,13 @@ static int st_dwc3_probe(struct platform_device *pdev)
>  
>  	dwc3_data->syscfg_reg_off = res->start;
>  
> -	dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
> +	dev_vdbg(dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
>  		 dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
>  
>  	struct device_node *child __free(device_node) = of_get_compatible_child(node,
>  										"snps,dwc3");
>  	if (!child) {
> -		dev_err(&pdev->dev, "failed to find dwc3 core node\n");
> +		dev_err(dev, "failed to find dwc3 core node\n");
>  		return -ENODEV;
>  	}
>  
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice
Thinh Nguyen Aug. 27, 2024, 1:19 a.m. UTC | #2
On Wed, Aug 14, 2024, Krzysztof Kozlowski wrote:
> The probe() function already stores '&pdev->dev' in local 'dev'
> variable.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/usb/dwc3/dwc3-st.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> index 7a0b1821768a..2841021f3557 100644
> --- a/drivers/usb/dwc3/dwc3-st.c
> +++ b/drivers/usb/dwc3/dwc3-st.c
> @@ -225,13 +225,13 @@ static int st_dwc3_probe(struct platform_device *pdev)
>  
>  	dwc3_data->syscfg_reg_off = res->start;
>  
> -	dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
> +	dev_vdbg(dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
>  		 dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
>  
>  	struct device_node *child __free(device_node) = of_get_compatible_child(node,
>  										"snps,dwc3");
>  	if (!child) {
> -		dev_err(&pdev->dev, "failed to find dwc3 core node\n");
> +		dev_err(dev, "failed to find dwc3 core node\n");
>  		return -ENODEV;
>  	}
>  
> 
> -- 
> 2.43.0
> 

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

Thanks,
Thinh
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
index 7a0b1821768a..2841021f3557 100644
--- a/drivers/usb/dwc3/dwc3-st.c
+++ b/drivers/usb/dwc3/dwc3-st.c
@@ -225,13 +225,13 @@  static int st_dwc3_probe(struct platform_device *pdev)
 
 	dwc3_data->syscfg_reg_off = res->start;
 
-	dev_vdbg(&pdev->dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
+	dev_vdbg(dev, "glue-logic addr 0x%pK, syscfg-reg offset 0x%x\n",
 		 dwc3_data->glue_base, dwc3_data->syscfg_reg_off);
 
 	struct device_node *child __free(device_node) = of_get_compatible_child(node,
 										"snps,dwc3");
 	if (!child) {
-		dev_err(&pdev->dev, "failed to find dwc3 core node\n");
+		dev_err(dev, "failed to find dwc3 core node\n");
 		return -ENODEV;
 	}