lkml.org 
[lkml]   [2023]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH -next] can: ctucanfd: Use devm_platform_ioremap_resource()
Date
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

\
 
 \ /
  Last update: 2023-03-27 00:25    [W:0.138 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site