Subject: Re: Allocation of MDIO bus numbers when fixed MDIO bus is enabled?

From: Anton Vorontsov <[email-masked]>
Date: Thu, 29 Dec 2011 23:10:11 +0400

Hello,

On Thu, Dec 29, 2011 at 05:09:44PM +0100, Florian Fainelli wrote:
> An user of the r6040 driver has enabled support for the Fixed MDIO
> bus, so when the r6040 registers with its first instance, it will
> also try to register a MDIO bus with id 0, and this fails.
> 
> What's the proper solution to fixing this kind of issue? The same
> user proposed to use the pci slot and function as an id for
> registering the MDIO bus, which will work for PCI devices, but not
> for platform_devices for instance.

AFAIR, MDIO bus id doesn't have to be numeric, so you can change it
to parent's dev_name(). I.e. something like

 snprintf(fmb->mii_bus->id, MII_BUS_ID_SIZE, "%s-mdio", dev_name(dev));

So, the resulting PHYs would have IDs something like "dev-mdio:1".

Thanks,

-- 
Anton Vorontsov
Email: [email-masked]