can: c_can: use devm_platform_get_and_ioremap_resource()
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2183338 Tested: Kernel booted on NXP-IMX8mquad and passed sanity tests on virtual CAN interface. Packets were sent while the can-utils package was used to listen on the vcan interface. commit 74d95352bdfc4ed1eb72ef9d69e06ed2d6891ff7 Author: Minghao Chi <chi.minghao@zte.com.cn> Date: Fri Nov 11 14:43:00 2022 +0800 can: c_can: use devm_platform_get_and_ioremap_resource() Convert platform_get_resource(), devm_ioremap_resource() to a single call to devm_platform_get_and_ioremap_resource(), as this is exactly what this function does. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/all/202211111443005202576@zte.com.cn Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> (cherry picked from commit 74d95352bdfc4ed1eb72ef9d69e06ed2d6891ff7) Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
This commit is contained in:
parent
75da8bf8e6
commit
e682910b29
|
@ -290,8 +290,7 @@ static int c_can_plat_probe(struct platform_device *pdev)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
addr = devm_ioremap_resource(&pdev->dev, mem);
|
||||
addr = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
|
||||
if (IS_ERR(addr)) {
|
||||
ret = PTR_ERR(addr);
|
||||
goto exit;
|
||||
|
|
Loading…
Reference in New Issue