diff options
author | YueHaibing <yuehaibing@huawei.com> | 2019-10-15 17:26:19 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-11-11 23:58:09 +0300 |
commit | 0ff8ee89624aaa74ee48a3015b4c1305b357e401 (patch) | |
tree | cc082140344ecf3cf7576164bbaed40859db19c1 /drivers/net/can/xilinx_can.c | |
parent | 91e9f2c0e7a49ec6a6673b4d97d535b838396fc9 (diff) | |
download | linux-0ff8ee89624aaa74ee48a3015b4c1305b357e401.tar.xz |
can: xilinx_can: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/xilinx_can.c')
-rw-r--r-- | drivers/net/can/xilinx_can.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index f33863379036..4a96e2dd7d77 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1657,7 +1657,6 @@ MODULE_DEVICE_TABLE(of, xcan_of_match); */ static int xcan_probe(struct platform_device *pdev) { - struct resource *res; /* IO mem resources */ struct net_device *ndev; struct xcan_priv *priv; const struct of_device_id *of_id; @@ -1669,8 +1668,7 @@ static int xcan_probe(struct platform_device *pdev) const char *hw_tx_max_property; /* Get the virtual base address for the device */ - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - addr = devm_ioremap_resource(&pdev->dev, res); + addr = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(addr)) { ret = PTR_ERR(addr); goto err; |