aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2019-08-21 20:48:50 +0800
committerDavid S. Miller <davem@davemloft.net>2019-08-21 13:42:12 -0700
commitc8ace62ff3a98bdc52c6df23c23465cfd9e3a847 (patch)
tree4ab91228bf6c9fede85a503c62e912f359f59c5d
parentamd-xgbe: use devm_platform_ioremap_resource() to simplify code (diff)
downloadlinux-dev-c8ace62ff3a98bdc52c6df23c23465cfd9e3a847.tar.xz
linux-dev-c8ace62ff3a98bdc52c6df23c23465cfd9e3a847.zip
net: ethernet: ti: 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: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 32a89744972d..54010957da5c 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2764,7 +2764,7 @@ static int cpsw_probe(struct platform_device *pdev)
struct net_device *ndev;
struct cpsw_priv *priv;
void __iomem *ss_regs;
- struct resource *res, *ss_res;
+ struct resource *ss_res;
struct gpio_descs *mode;
const struct soc_device_attribute *soc;
struct cpsw_common *cpsw;
@@ -2798,8 +2798,7 @@ static int cpsw_probe(struct platform_device *pdev)
return PTR_ERR(ss_regs);
cpsw->regs = ss_regs;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
- cpsw->wr_regs = devm_ioremap_resource(dev, res);
+ cpsw->wr_regs = devm_platform_ioremap_resource(pdev, 1);
if (IS_ERR(cpsw->wr_regs))
return PTR_ERR(cpsw->wr_regs);