Skip to content

Commit 93e91b3

Browse files
rperierdavem330
authored andcommitted
ethernet: arc: mdio changes for future SoC glue layer devtree support
This is an api changes for the emac_mdio.c module. It will be required later when arc_emac_probe/arc_emac_remove will no longer use 'struct platform_device'. Signed-off-by: Romain Perier <romain.perier@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent f15f44e commit 93e91b3

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎drivers/net/ethernet/arc/emac.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static inline void arc_reg_clr(struct arc_emac_priv *priv, int reg, int mask)
204204
arc_reg_set(priv, reg, value & ~mask);
205205
}
206206

207-
int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv);
207+
int arc_mdio_probe(struct arc_emac_priv *priv);
208208
int arc_mdio_remove(struct arc_emac_priv *priv);
209209

210210
#endif /* ARC_EMAC_H */

‎drivers/net/ethernet/arc/emac_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static int arc_emac_probe(struct platform_device *pdev)
799799
dev_dbg(dev, "EMAC Device addr: Rx Ring [0x%x], Tx Ring[%x]\n",
800800
(unsigned int)priv->rxbd_dma, (unsigned int)priv->txbd_dma);
801801

802-
err = arc_mdio_probe(pdev, priv);
802+
err = arc_mdio_probe(priv);
803803
if (err) {
804804
dev_err(dev, "failed to probe MII bus\n");
805805
goto out_clken;

‎drivers/net/ethernet/arc/emac_mdio.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,14 @@ static int arc_mdio_write(struct mii_bus *bus, int phy_addr,
100100

101101
/**
102102
* arc_mdio_probe - MDIO probe function.
103-
* @pdev: Pointer to platform device.
104103
* @priv: Pointer to ARC EMAC private data structure.
105104
*
106105
* returns: 0 on success, -ENOMEM when mdiobus_alloc
107106
* (to allocate memory for MII bus structure) fails.
108107
*
109108
* Sets up and registers the MDIO interface.
110109
*/
111-
int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv)
110+
int arc_mdio_probe(struct arc_emac_priv *priv)
112111
{
113112
struct mii_bus *bus;
114113
int error;
@@ -124,9 +123,9 @@ int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv)
124123
bus->read = &arc_mdio_read;
125124
bus->write = &arc_mdio_write;
126125

127-
snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name);
126+
snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);
128127

129-
error = of_mdiobus_register(bus, pdev->dev.of_node);
128+
error = of_mdiobus_register(bus, priv->dev->of_node);
130129
if (error) {
131130
dev_err(priv->dev, "cannot register MDIO bus %s\n", bus->name);
132131
mdiobus_free(bus);

0 commit comments

Comments
 (0)