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

phy: mdio-moxart: 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
ea707692 ba869d3c

+1 -3
+1 -3
drivers/net/phy/mdio-moxart.c
··· 113 113 struct device_node *np = pdev->dev.of_node; 114 114 struct mii_bus *bus; 115 115 struct moxart_mdio_data *data; 116 - struct resource *res; 117 116 int ret, i; 118 117 119 118 bus = mdiobus_alloc_size(sizeof(*data)); ··· 137 138 bus->irq[i] = PHY_IGNORE_INTERRUPT; 138 139 139 140 data = bus->priv; 140 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 141 - data->base = devm_ioremap_resource(&pdev->dev, res); 141 + data->base = devm_platform_ioremap_resource(pdev, 0); 142 142 if (IS_ERR(data->base)) { 143 143 ret = PTR_ERR(data->base); 144 144 goto err_out_free_mdiobus;