]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sh_eth: add PHY IRQ to platform data
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Thu, 19 Dec 2013 22:39:52 +0000 (01:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Dec 2013 00:09:38 +0000 (19:09 -0500)
Allow the platform code to pass PHY's IRQ to the driver.  Print this IRQ along
with the other PHY datails in sh_eth_phy_init().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c
include/linux/sh_eth.h

index 8601d0c638cc2a7ab76bf5092ab80e280a90e483..9d8013f82019e4d368e3843843fef2bf583cd94f 100644 (file)
@@ -1685,8 +1685,8 @@ static int sh_eth_phy_init(struct net_device *ndev)
                return PTR_ERR(phydev);
        }
 
-       dev_info(&ndev->dev, "attached phy %i to driver %s\n",
-               phydev->addr, phydev->drv->name);
+       dev_info(&ndev->dev, "attached PHY %d (IRQ %d) to driver %s\n",
+                phydev->addr, phydev->irq, phydev->drv->name);
 
        mdp->phydev = phydev;
 
@@ -2544,6 +2544,8 @@ static int sh_mdio_init(struct net_device *ndev, int id,
 
        for (i = 0; i < PHY_MAX_ADDR; i++)
                mdp->mii_bus->irq[i] = PHY_POLL;
+       if (pd->phy_irq > 0)
+               mdp->mii_bus->irq[pd->phy] = pd->phy_irq;
 
        /* register mdio bus */
        ret = mdiobus_register(mdp->mii_bus);
index 90b5e30c2f222ba8e06deb9d347940bf7d5aa94b..8c9131db2b252cf00aedab4d782e77c2c96bb5ea 100644 (file)
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
 
 struct sh_eth_plat_data {
        int phy;
+       int phy_irq;
        int edmac_endian;
        phy_interface_t phy_interface;
        void (*set_mdio_gate)(void *addr);