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

phy: mdio-sun4i: 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
3894793e bd51ce05

+1 -3
+1 -3
drivers/net/phy/mdio-sun4i.c
··· 92 92 struct device_node *np = pdev->dev.of_node; 93 93 struct mii_bus *bus; 94 94 struct sun4i_mdio_data *data; 95 - struct resource *res; 96 95 int ret; 97 96 98 97 bus = mdiobus_alloc_size(sizeof(*data)); ··· 105 106 bus->parent = &pdev->dev; 106 107 107 108 data = bus->priv; 108 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 109 - data->membase = devm_ioremap_resource(&pdev->dev, res); 109 + data->membase = devm_platform_ioremap_resource(pdev, 0); 110 110 if (IS_ERR(data->membase)) { 111 111 ret = PTR_ERR(data->membase); 112 112 goto err_out_free_mdiobus;