Message ID | 20220610080059.2333501-3-joel@jms.id.au |
---|---|
State | New |
Headers | show |
Series | Better NCSI support | expand |
On 6/10/22 10:00, Joel Stanley wrote: > phy_connect would unconditionally create a NCSI PHY device if the driver > was configured. > > By detecting what the phy type is at runtime we can support NCSI and > non-NCSI system with the same defconfig, > > Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Cédric Le Goater <clg@kaod.org> Thanks, C. > --- > drivers/net/phy/phy.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c > index a0f7b7964464..8e70746a1e76 100644 > --- a/drivers/net/phy/phy.c > +++ b/drivers/net/phy/phy.c > @@ -932,7 +932,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, > #endif > > #ifdef CONFIG_PHY_NCSI > - phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface); > + if (interface == PHY_INTERFACE_MODE_NCSI) > + phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface); > #endif > > if (!phydev)
On Fri, 10 Jun 2022 at 08:37, Cédric Le Goater <clg@kaod.org> wrote: > > On 6/10/22 10:00, Joel Stanley wrote: > > phy_connect would unconditionally create a NCSI PHY device if the driver > > was configured. > > > > By detecting what the phy type is at runtime we can support NCSI and > > non-NCSI system with the same defconfig, > > > > Signed-off-by: Joel Stanley <joel@jms.id.au> > > Reviewed-by: Cédric Le Goater <clg@kaod.org> Merged, thanks.
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index a0f7b7964464..8e70746a1e76 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -932,7 +932,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr, #endif #ifdef CONFIG_PHY_NCSI - phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface); + if (interface == PHY_INTERFACE_MODE_NCSI) + phydev = phy_device_create(bus, 0, PHY_NCSI_ID, false, interface); #endif if (!phydev)
phy_connect would unconditionally create a NCSI PHY device if the driver was configured. By detecting what the phy type is at runtime we can support NCSI and non-NCSI system with the same defconfig, Signed-off-by: Joel Stanley <joel@jms.id.au> --- drivers/net/phy/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)