Skip to content

Commit

Permalink
ethernet: arc: mdio changes for future SoC glue layer devtree support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Romain Perier authored and David S. Miller committed Aug 27, 2014
1 parent f15f44e commit 93e91b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/arc/emac.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static inline void arc_reg_clr(struct arc_emac_priv *priv, int reg, int mask)
arc_reg_set(priv, reg, value & ~mask);
}

int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv);
int arc_mdio_probe(struct arc_emac_priv *priv);
int arc_mdio_remove(struct arc_emac_priv *priv);

#endif /* ARC_EMAC_H */
2 changes: 1 addition & 1 deletion drivers/net/ethernet/arc/emac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ static int arc_emac_probe(struct platform_device *pdev)
dev_dbg(dev, "EMAC Device addr: Rx Ring [0x%x], Tx Ring[%x]\n",
(unsigned int)priv->rxbd_dma, (unsigned int)priv->txbd_dma);

err = arc_mdio_probe(pdev, priv);
err = arc_mdio_probe(priv);
if (err) {
dev_err(dev, "failed to probe MII bus\n");
goto out_clken;
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/ethernet/arc/emac_mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,14 @@ static int arc_mdio_write(struct mii_bus *bus, int phy_addr,

/**
* arc_mdio_probe - MDIO probe function.
* @pdev: Pointer to platform device.
* @priv: Pointer to ARC EMAC private data structure.
*
* returns: 0 on success, -ENOMEM when mdiobus_alloc
* (to allocate memory for MII bus structure) fails.
*
* Sets up and registers the MDIO interface.
*/
int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv)
int arc_mdio_probe(struct arc_emac_priv *priv)
{
struct mii_bus *bus;
int error;
Expand All @@ -124,9 +123,9 @@ int arc_mdio_probe(struct platform_device *pdev, struct arc_emac_priv *priv)
bus->read = &arc_mdio_read;
bus->write = &arc_mdio_write;

snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name);
snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name);

error = of_mdiobus_register(bus, pdev->dev.of_node);
error = of_mdiobus_register(bus, priv->dev->of_node);
if (error) {
dev_err(priv->dev, "cannot register MDIO bus %s\n", bus->name);
mdiobus_free(bus);
Expand Down

0 comments on commit 93e91b3

Please sign in to comment.