Commit c8ace62f authored by YueHaibing's avatar YueHaibing Committed by David S. Miller
Browse files

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eba39fd6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);