Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4d00f17 authored by Kumar Gala's avatar Kumar Gala Committed by Jeff Garzik
Browse files

[PATCH] phy: Added a macro to represent the string format used to match a phy device



Add the PHY_ID_FMT macro to ensure that the format of the id string used by a
driver to match to its specific phy is consistent between the mdio_bus and the
driver.

Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 1d532677
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ int mdiobus_register(struct mii_bus *bus)

			phydev->dev.parent = bus->dev;
			phydev->dev.bus = &mdio_bus_type;
			sprintf(phydev->dev.bus_id, "phy%d:%d", bus->id, i);
			snprintf(phydev->dev.bus_id, BUS_ID_SIZE, PHY_ID_FMT, bus->id, i);

			phydev->bus = bus;

+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@
 */
void phy_print_status(struct phy_device *phydev)
{
	pr_info("%s: Link is %s", phydev->dev.bus_id,
	pr_info("PHY: %s - Link is %s", phydev->dev.bus_id,
			phydev->link ? "Up" : "Down");
	if (phydev->link)
		printk(" - %d/%s", phydev->speed,
+3 −0
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@

#define PHY_MAX_ADDR 32

/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
#define PHY_ID_FMT "%x:%02x"

/* The Bus class for PHYs.  Devices which provide access to
 * PHYs should register using this structure */
struct mii_bus {