From: Andrew Lunn <andrew@lunn.ch>
To: Petr Wozniak <petr.wozniak@gmail.com>
Cc: linux-netdev@vger.kernel.org, bjorn@mork.no,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: sfp: probe for RollBall I2C-to-MDIO bridge before assuming MDIO_I2C_ROLLBALL
Date: Fri, 15 May 2026 15:28:43 +0200 [thread overview]
Message-ID: <618d5fd2-0f2b-4ea1-b580-345a6f13bcd2@lunn.ch> (raw)
In-Reply-To: <20260515115527.17241-1-petr.wozniak@gmail.com>
> -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
prev parent reply other threads:[~2026-05-15 13:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 11:55 Petr Wozniak
2026-05-15 13:28 ` Andrew Lunn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=618d5fd2-0f2b-4ea1-b580-345a6f13bcd2@lunn.ch \
--to=andrew@lunn.ch \
--cc=bjorn@mork.no \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-netdev@vger.kernel.org \
--cc=petr.wozniak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®