ar71xx: Add kernel 4.9 support
[openwrt/staging/jow.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_mdio.c
index 71ae8258b2ef20f7d20ceacec59011ab3babfe23..2915476569c5c7fba1558d6fa7fab521f2b37f60 100644 (file)
@@ -234,7 +234,7 @@ static int ag71xx_mdio_probe(struct platform_device *pdev)
        if (!res) {
                dev_err(&pdev->dev, "no iomem resource found\n");
                err = -ENXIO;
-               goto err_out;
+               goto err_free_mdio;
        }
 
        am->mdio_base = ioremap_nocache(res->start, res->end - res->start + 1);
@@ -254,7 +254,11 @@ static int ag71xx_mdio_probe(struct platform_device *pdev)
        am->mii_bus->read = ag71xx_mdio_read;
        am->mii_bus->write = ag71xx_mdio_write;
        am->mii_bus->reset = ag71xx_mdio_reset;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0)
        am->mii_bus->irq = am->mii_irq;
+#else
+       memcpy(am->mii_bus->irq, am->mii_irq, sizeof(am->mii_bus->irq));
+#endif
        am->mii_bus->priv = am;
        am->mii_bus->parent = &pdev->dev;
        snprintf(am->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev_name(&pdev->dev));