diff mbox series

usb: renesas_usbhs: Remove renesas_usbhs_get_info() wrapper

Message ID fa296af4452dfe394a58b75fd44c3bb9591936eb.1713282736.git.geert+renesas@glider.be (mailing list archive)
State Accepted
Commit bd2cd796d2859c1a7cee326d7a9c0f77c6b95c71
Headers show
Series usb: renesas_usbhs: Remove renesas_usbhs_get_info() wrapper | expand

Commit Message

Geert Uytterhoeven April 16, 2024, 3:53 p.m. UTC
The renesas_usbhs_get_info() wrapper was useful for legacy board code.
Since commit 1fa59bda21c7fa36 ("ARM: shmobile: Remove legacy board code
for Armadillo-800 EVA") in v4.3, it is no longer used outside the USBHS
driver, and provides no added value over dev_get_platdata(), while
obfuscating the real operation.

Drop it, and replace it by dev_get_platdata() in its sole user.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/usb/renesas_usbhs/common.c | 2 +-
 include/linux/usb/renesas_usbhs.h  | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

Comments

Biju Das April 16, 2024, 3:57 p.m. UTC | #1
Hi Geert,

Thanks for the patch.

> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: Tuesday, April 16, 2024 4:54 PM
> Subject: [PATCH] usb: renesas_usbhs: Remove renesas_usbhs_get_info() wrapper
> 
> The renesas_usbhs_get_info() wrapper was useful for legacy board code.
> Since commit 1fa59bda21c7fa36 ("ARM: shmobile: Remove legacy board code for Armadillo-800 EVA") in
> v4.3, it is no longer used outside the USBHS driver, and provides no added value over
> dev_get_platdata(), while obfuscating the real operation.
> 
> Drop it, and replace it by dev_get_platdata() in its sole user.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>

Cheers,
Biju

> ---
>  drivers/usb/renesas_usbhs/common.c | 2 +-  include/linux/usb/renesas_usbhs.h  | 5 -----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index b6bef9081bf275f0..edc43f169d493c65 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -613,7 +613,7 @@ static int usbhs_probe(struct platform_device *pdev)
> 
>  	info = of_device_get_match_data(dev);
>  	if (!info) {
> -		info = renesas_usbhs_get_info(pdev);
> +		info = dev_get_platdata(dev);
>  		if (!info)
>  			return dev_err_probe(dev, -EINVAL, "no platform info\n");
>  	}
> diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
> index 372898d9eeb00bbc..67bfcda6c7d2779e 100644
> --- a/include/linux/usb/renesas_usbhs.h
> +++ b/include/linux/usb/renesas_usbhs.h
> @@ -194,9 +194,4 @@ struct renesas_usbhs_platform_info {
>  	struct renesas_usbhs_driver_param	driver_param;
>  };
> 
> -/*
> - * macro for platform
> - */
> -#define renesas_usbhs_get_info(pdev)\
> -	((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
>  #endif /* RENESAS_USB_H */
> --
> 2.34.1
Yoshihiro Shimoda April 17, 2024, 7:36 a.m. UTC | #2
Hi Geert-san,

> From: Geert Uytterhoeven, Sent: Wednesday, April 17, 2024 12:54 AM
> 
> The renesas_usbhs_get_info() wrapper was useful for legacy board code.
> Since commit 1fa59bda21c7fa36 ("ARM: shmobile: Remove legacy board code
> for Armadillo-800 EVA") in v4.3, it is no longer used outside the USBHS
> driver, and provides no added value over dev_get_platdata(), while
> obfuscating the real operation.
> 
> Drop it, and replace it by dev_get_platdata() in its sole user.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thank you for the patch!

Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda

> ---
>  drivers/usb/renesas_usbhs/common.c | 2 +-
>  include/linux/usb/renesas_usbhs.h  | 5 -----
>  2 files changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> index b6bef9081bf275f0..edc43f169d493c65 100644
> --- a/drivers/usb/renesas_usbhs/common.c
> +++ b/drivers/usb/renesas_usbhs/common.c
> @@ -613,7 +613,7 @@ static int usbhs_probe(struct platform_device *pdev)
> 
>  	info = of_device_get_match_data(dev);
>  	if (!info) {
> -		info = renesas_usbhs_get_info(pdev);
> +		info = dev_get_platdata(dev);
>  		if (!info)
>  			return dev_err_probe(dev, -EINVAL, "no platform info\n");
>  	}
> diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
> index 372898d9eeb00bbc..67bfcda6c7d2779e 100644
> --- a/include/linux/usb/renesas_usbhs.h
> +++ b/include/linux/usb/renesas_usbhs.h
> @@ -194,9 +194,4 @@ struct renesas_usbhs_platform_info {
>  	struct renesas_usbhs_driver_param	driver_param;
>  };
> 
> -/*
> - * macro for platform
> - */
> -#define renesas_usbhs_get_info(pdev)\
> -	((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
>  #endif /* RENESAS_USB_H */
> --
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
index b6bef9081bf275f0..edc43f169d493c65 100644
--- a/drivers/usb/renesas_usbhs/common.c
+++ b/drivers/usb/renesas_usbhs/common.c
@@ -613,7 +613,7 @@  static int usbhs_probe(struct platform_device *pdev)
 
 	info = of_device_get_match_data(dev);
 	if (!info) {
-		info = renesas_usbhs_get_info(pdev);
+		info = dev_get_platdata(dev);
 		if (!info)
 			return dev_err_probe(dev, -EINVAL, "no platform info\n");
 	}
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 372898d9eeb00bbc..67bfcda6c7d2779e 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -194,9 +194,4 @@  struct renesas_usbhs_platform_info {
 	struct renesas_usbhs_driver_param	driver_param;
 };
 
-/*
- * macro for platform
- */
-#define renesas_usbhs_get_info(pdev)\
-	((struct renesas_usbhs_platform_info *)(pdev)->dev.platform_data)
 #endif /* RENESAS_USB_H */