ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, t);
udelay(100);
+ if (am->pdata->reset)
+ am->pdata->reset(bus);
+
return 0;
}
return 0;
}
-static int __devinit ag71xx_mdio_probe(struct platform_device *pdev)
+static int ag71xx_mdio_probe(struct platform_device *pdev)
{
struct ag71xx_mdio_platform_data *pdata;
struct ag71xx_mdio *am;
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);
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));
return err;
}
-static int __devexit ag71xx_mdio_remove(struct platform_device *pdev)
+static int ag71xx_mdio_remove(struct platform_device *pdev)
{
struct ag71xx_mdio *am = platform_get_drvdata(pdev);
static struct platform_driver ag71xx_mdio_driver = {
.probe = ag71xx_mdio_probe,
- .remove = __exit_p(ag71xx_mdio_remove),
+ .remove = ag71xx_mdio_remove,
.driver = {
.name = "ag71xx-mdio",
}