[PATCH] realtek: Fix kernel dependencies on CONFIG_MDIO_SMBUS

Birger Koblitz mail at birger-koblitz.de
Tue Mar 15 05:59:59 PDT 2022


Hi,

On 15.03.22 13:32, Bjørn Mork wrote:
> Birger Koblitz <mail at birger-koblitz.de> writes:

> Yuck!
> 
> Why the heck can't this be made generic, auto-configured by DTS props
> and upstreamed?  There is a reason for this, you know:
> 
> bjorn at miraculix:/usr/local/src/git/linux$ git grep -E '^#ifdef' drivers/net/phy/sfp.c|wc -c
> 0
> 
Well, we can of course always compile SMBus support in, i.e. make CONFIG_SFP depend on CONFIG_MDIO_SMBUS,
this is already done for the I2C equivalent and this is where we started:
config SFP
        tristate "SFP cage support"
        depends on I2C && PHYLINK
        depends on HWMON || HWMON=n
        select MDIO_I2C
+	select CONFIG_MDIO_SMBUS

But if we do not want to do that then #ifdefs are the only solution to prevent compiler errors
due to missing symbols. There is no need to do anything in a dts BTW. The code is already
auto-configuring, it first tries I2C which is more powerful and then
falls back to SMBus before it gives up.

Cheers,
  Birger




More information about the openwrt-devel mailing list