linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource()
@ 2023-02-16  9:06 Yang Li
  2023-02-16  9:36 ` Pavel Pisa
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yang Li @ 2023-02-16  9:06 UTC (permalink / raw)
  To: kuba
  Cc: davem, edumazet, pisa, ondrej.ille, wg, mkl, pabeni, linux-can,
	netdev, linux-kernel, Yang Li

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to Use devm_platform_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/net/can/ctucanfd/ctucanfd_platform.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c b/drivers/net/can/ctucanfd/ctucanfd_platform.c
index f83684f006ea..a17561d97192 100644
--- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
+++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
@@ -47,7 +47,6 @@ static void ctucan_platform_set_drvdata(struct device *dev,
  */
 static int ctucan_platform_probe(struct platform_device *pdev)
 {
-	struct resource *res; /* IO mem resources */
 	struct device	*dev = &pdev->dev;
 	void __iomem *addr;
 	int ret;
@@ -55,8 +54,7 @@ static int ctucan_platform_probe(struct platform_device *pdev)
 	int irq;
 
 	/* Get the virtual base address for the device */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	addr = devm_ioremap_resource(dev, res);
+	addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(addr)) {
 		ret = PTR_ERR(addr);
 		goto err;
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource()
  2023-02-16  9:06 [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource() Yang Li
@ 2023-02-16  9:36 ` Pavel Pisa
  2023-02-16 16:56 ` Alexander Lobakin
  2023-02-16 20:05 ` Marc Kleine-Budde
  2 siblings, 0 replies; 4+ messages in thread
From: Pavel Pisa @ 2023-02-16  9:36 UTC (permalink / raw)
  To: Yang Li
  Cc: kuba, davem, edumazet, ondrej.ille, wg, mkl, pabeni, linux-can,
	netdev, linux-kernel

On Thursday 16 of February 2023 10:06:10 Yang Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to Use devm_platform_ioremap_resource(), as this is exactly
> what this function does.
>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>

> ---
>  drivers/net/can/ctucanfd/ctucanfd_platform.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c
> b/drivers/net/can/ctucanfd/ctucanfd_platform.c index
> f83684f006ea..a17561d97192 100644
> --- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
> +++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
> @@ -47,7 +47,6 @@ static void ctucan_platform_set_drvdata(struct device
> *dev, */
>  static int ctucan_platform_probe(struct platform_device *pdev)
>  {
> -	struct resource *res; /* IO mem resources */
>  	struct device	*dev = &pdev->dev;
>  	void __iomem *addr;
>  	int ret;
> @@ -55,8 +54,7 @@ static int ctucan_platform_probe(struct platform_device
> *pdev) int irq;
>
>  	/* Get the virtual base address for the device */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	addr = devm_ioremap_resource(dev, res);
> +	addr = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(addr)) {
>  		ret = PTR_ERR(addr);
>  		goto err;


-- 
                Pavel Pisa
    e-mail:     pisa@cmp.felk.cvut.cz
    Department of Control Engineering FEE CVUT
    Karlovo namesti 13, 121 35, Prague 2
    university: http://control.fel.cvut.cz/
    personal:   http://cmp.felk.cvut.cz/~pisa
    projects:   https://www.openhub.net/accounts/ppisa
    CAN related:http://canbus.pages.fel.cvut.cz/
    RISC-V education: https://comparch.edu.cvut.cz/
    Open Technologies Research Education and Exchange Services
    https://gitlab.fel.cvut.cz/otrees/org/-/wikis/home


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource()
  2023-02-16  9:06 [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource() Yang Li
  2023-02-16  9:36 ` Pavel Pisa
@ 2023-02-16 16:56 ` Alexander Lobakin
  2023-02-16 20:05 ` Marc Kleine-Budde
  2 siblings, 0 replies; 4+ messages in thread
From: Alexander Lobakin @ 2023-02-16 16:56 UTC (permalink / raw)
  To: Yang Li
  Cc: kuba, davem, edumazet, pisa, ondrej.ille, wg, mkl, pabeni,
	linux-can, netdev, linux-kernel

From: Yang Li <yang.lee@linux.alibaba.com>
Date: Thu, 16 Feb 2023 17:06:10 +0800

> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to Use devm_platform_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>

> ---
>  drivers/net/can/ctucanfd/ctucanfd_platform.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/can/ctucanfd/ctucanfd_platform.c b/drivers/net/can/ctucanfd/ctucanfd_platform.c
> index f83684f006ea..a17561d97192 100644
> --- a/drivers/net/can/ctucanfd/ctucanfd_platform.c
> +++ b/drivers/net/can/ctucanfd/ctucanfd_platform.c
> @@ -47,7 +47,6 @@ static void ctucan_platform_set_drvdata(struct device *dev,
>   */
>  static int ctucan_platform_probe(struct platform_device *pdev)
>  {
> -	struct resource *res; /* IO mem resources */
>  	struct device	*dev = &pdev->dev;
>  	void __iomem *addr;
>  	int ret;
> @@ -55,8 +54,7 @@ static int ctucan_platform_probe(struct platform_device *pdev)
>  	int irq;
>  
>  	/* Get the virtual base address for the device */
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	addr = devm_ioremap_resource(dev, res);
> +	addr = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(addr)) {
>  		ret = PTR_ERR(addr);
>  		goto err;
Thanks,
Olek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource()
  2023-02-16  9:06 [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource() Yang Li
  2023-02-16  9:36 ` Pavel Pisa
  2023-02-16 16:56 ` Alexander Lobakin
@ 2023-02-16 20:05 ` Marc Kleine-Budde
  2 siblings, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2023-02-16 20:05 UTC (permalink / raw)
  To: Yang Li
  Cc: kuba, davem, edumazet, pisa, ondrej.ille, wg, pabeni, linux-can,
	netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

On 16.02.2023 17:06:10, Yang Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to Use devm_platform_ioremap_resource(), as this is exactly
> what this function does.
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Applied to linux-can-next/testing.

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-16 20:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16  9:06 [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource() Yang Li
2023-02-16  9:36 ` Pavel Pisa
2023-02-16 16:56 ` Alexander Lobakin
2023-02-16 20:05 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).