Commit 7c0c8268 authored by Bert Vermeulen's avatar Bert Vermeulen Committed by David S. Miller

net: mdio-gpio: Allow for unspecified bus id

When the bus id was supplied via a struct platform_device, the driver wasn't
handling -1 to mean an unspecified id of the only instance of this driver,
as the platform spec requires.
Signed-off-by: default avatarBert Vermeulen <bert@biot.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fbf33a28
...@@ -168,7 +168,10 @@ static struct mii_bus *mdio_gpio_bus_init(struct device *dev, ...@@ -168,7 +168,10 @@ static struct mii_bus *mdio_gpio_bus_init(struct device *dev,
if (!new_bus->irq[i]) if (!new_bus->irq[i])
new_bus->irq[i] = PHY_POLL; new_bus->irq[i] = PHY_POLL;
snprintf(new_bus->id, MII_BUS_ID_SIZE, "gpio-%x", bus_id); if (bus_id != -1)
snprintf(new_bus->id, MII_BUS_ID_SIZE, "gpio-%x", bus_id);
else
strncpy(new_bus->id, "gpio", MII_BUS_ID_SIZE);
if (devm_gpio_request(dev, bitbang->mdc, "mdc")) if (devm_gpio_request(dev, bitbang->mdc, "mdc"))
goto out_free_bus; goto out_free_bus;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment