can: ctucanfd: ctucan_platform_probe(): use devm_platform_ioremap_resource()

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>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Link: https://lore.kernel.org/all/20230216090610.130860-1-yang.lee@linux.alibaba.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Yang Li 2023-02-16 17:06:10 +08:00 committed by Marc Kleine-Budde
parent 40967f77df
commit 470ac62dfa

View file

@ -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;