Re: [PATCH] net: phy: sfp: probe for RollBall I2C-to-MDIO bridge before assuming MDIO_I2C_ROLLBALL

From: Andrew Lunn

Date: Fri May 15 2026 - 09:34:54 EST


> -static void sfp_fixup_rollball_cc(struct sfp *sfp)
> +/* Local mirrors of RollBall protocol constants from mdio-i2c.c */
> +#define SFP_ROLLBALL_PHY_ADDR 0x51
> +#define SFP_ROLLBALL_MDIO_PAGE 3
> +#define SFP_ROLLBALL_CMD_ADDR 0x80
> +#define SFP_ROLLBALL_CMD_READ 0x02
> +#define SFP_ROLLBALL_CMD_DONE 0x04

Please don't replicate code like this.

Could the probing be moved into i2c_mii_init_rollball() ? Return
-ENODEV if the probe fail? mdio_i2c_alloc() can then set
sfp->mdio_protocol to MDIO_I2C_NONE?

That would keep all the MDIO protocol stuff together.

Andrew

---
pw-bot: cr