]> git.baikalelectronics.ru Git - kernel.git/commit
net: sfp: create/destroy I2C mdiobus before PHY probe/after PHY release
authorMarek Behún <kabel@kernel.org>
Fri, 30 Sep 2022 14:21:08 +0000 (16:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Oct 2022 10:08:33 +0000 (11:08 +0100)
commitf8e26759898f110846a6bc2b5361f6860bb968cf
tree393079f23e9d9b2ee7bfd3b83eefbc36a814b1de
parentd4310b67c71c1e9fe28853a2c4ae59d5e8167bb8
net: sfp: create/destroy I2C mdiobus before PHY probe/after PHY release

Instead of configuring the I2C mdiobus when SFP driver is probed,
create/destroy the mdiobus before the PHY is probed for/after it is
released.

This way we can tell the mdio-i2c code which protocol to use for each
SFP transceiver.

Move the code that determines MDIO I2C protocol from
sfp_sm_probe_for_phy() to sfp_sm_mod_probe(), where most of the SFP ID
parsing is done. Don't allocate I2C bus if no PHY is expected.

Signed-off-by: Marek Behún <kabel@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/sfp.c
include/linux/mdio/mdio-i2c.h