Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: mdio-mux-meson-g12a: 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>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

YueHaibing and committed by
David S. Miller
bd51ce05 ea707692

+1 -3
+1 -3
drivers/net/phy/mdio-mux-meson-g12a.c
··· 302 302 { 303 303 struct device *dev = &pdev->dev; 304 304 struct g12a_mdio_mux *priv; 305 - struct resource *res; 306 305 int ret; 307 306 308 307 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 310 311 311 312 platform_set_drvdata(pdev, priv); 312 313 313 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 314 - priv->regs = devm_ioremap_resource(dev, res); 314 + priv->regs = devm_platform_ioremap_resource(pdev, 0); 315 315 if (IS_ERR(priv->regs)) 316 316 return PTR_ERR(priv->regs); 317 317