mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 01:04:08 +08:00
can: grcan: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
6b43a26508
commit
65725aa882
@ -1652,7 +1652,6 @@ exit_free_candev:
|
||||
static int grcan_probe(struct platform_device *ofdev)
|
||||
{
|
||||
struct device_node *np = ofdev->dev.of_node;
|
||||
struct resource *res;
|
||||
u32 sysid, ambafreq;
|
||||
int irq, err;
|
||||
void __iomem *base;
|
||||
@ -1672,8 +1671,7 @@ static int grcan_probe(struct platform_device *ofdev)
|
||||
goto exit_error;
|
||||
}
|
||||
|
||||
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
|
||||
base = devm_ioremap_resource(&ofdev->dev, res);
|
||||
base = devm_platform_ioremap_resource(ofdev, 0);
|
||||
if (IS_ERR(base)) {
|
||||
err = PTR_ERR(base);
|
||||
goto exit_error;
|
||||
|
Loading…
Reference in New Issue
Block a user