diff mbox series

Input: tegra-kbc - use devm_platform_ioremap_resource

Message ID 20230709134109.182418-1-martin@kaiser.cx
State New
Headers show
Series Input: tegra-kbc - use devm_platform_ioremap_resource | expand

Commit Message

Martin Kaiser July 9, 2023, 1:41 p.m. UTC
devm_platform_get_and_ioremap_resource maps a resource and returns its
physical address. If we don't need the physical address, we should call
devm_platform_ioremap_resource instead.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
 drivers/input/keyboard/tegra-kbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thierry Reding July 10, 2023, 1:11 p.m. UTC | #1
On Sun, Jul 09, 2023 at 03:41:08PM +0200, Martin Kaiser wrote:
> devm_platform_get_and_ioremap_resource maps a resource and returns its
> physical address. If we don't need the physical address, we should call
> devm_platform_ioremap_resource instead.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>
> ---
>  drivers/input/keyboard/tegra-kbc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Different variations of these have been going around for a while now. I
don't really see much use in these tiny conversions.

But the patch also isn't wrong, so while I'm at it:

Acked-by: Thierry Reding <treding@nvidia.com>


> 
> diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
> index d5a6c7d8eb25..c9a823ea45d0 100644
> --- a/drivers/input/keyboard/tegra-kbc.c
> +++ b/drivers/input/keyboard/tegra-kbc.c
> @@ -640,7 +640,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
>  
>  	timer_setup(&kbc->timer, tegra_kbc_keypress_timer, 0);
>  
> -	kbc->mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
> +	kbc->mmio = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(kbc->mmio))
>  		return PTR_ERR(kbc->mmio);
>  
> -- 
> 2.30.2
>
Dmitry Torokhov July 10, 2023, 7:08 p.m. UTC | #2
On Sun, Jul 09, 2023 at 03:41:08PM +0200, Martin Kaiser wrote:
> devm_platform_get_and_ioremap_resource maps a resource and returns its
> physical address. If we don't need the physical address, we should call
> devm_platform_ioremap_resource instead.
> 
> Signed-off-by: Martin Kaiser <martin@kaiser.cx>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index d5a6c7d8eb25..c9a823ea45d0 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -640,7 +640,7 @@  static int tegra_kbc_probe(struct platform_device *pdev)
 
 	timer_setup(&kbc->timer, tegra_kbc_keypress_timer, 0);
 
-	kbc->mmio = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
+	kbc->mmio = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(kbc->mmio))
 		return PTR_ERR(kbc->mmio);