@@ -111,15 +111,16 @@ ipq8064_mdio_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct ipq8064_mdio *priv;
- struct resource res;
+ struct resource *res;
struct mii_bus *bus;
void __iomem *base;
int ret;
- if (of_address_to_resource(np, 0, &res))
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res)
return -ENOMEM;
- base = devm_ioremap(&pdev->dev, res.start, resource_size(&res));
+ base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
if (!base)
return -ENOMEM;
There's no need to get the of_node explicitly. platform_get_resource already does this. Signed-off-by: Rosen Penev <rosenp@gmail.com> --- drivers/net/mdio/mdio-ipq8064.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)