[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180110140559.GB32117@lunn.ch>
Date: Wed, 10 Jan 2018 15:05:59 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: David Miller <davem@...emloft.net>, netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] net: phy: marvell: mv88e6390 temperature sensor
reading
> > > +static int m88e6390_hwmon_probe(struct phy_device *phydev)
> > > +{
> > > + return marvell_hwmon_probe(phydev, &m88e6390_hwmon_chip_info);
> > > +}
> > > #else
> > > static int m88e1121_hwmon_probe(struct phy_device *phydev)
> > > {
> > > @@ -1794,6 +1927,11 @@ static int m88e1510_hwmon_probe(struct phy_device *phydev)
> > > {
> > > return 0;
> > > }
> > > +
> > > +static int m88e6390_hwmon_probe(struct phy_device *phydev)
> > > +{
> > > + return 0;
> > > +}
> >
> > Instead of having to define m88e6390_hwmon_probe() twice, I would just
> > make marvell_hwmon_probe() a stub when CONFIG_HWMON=n?
>
> Yes, i could do that. But again, i'm just following the pattern from
> the other two sensors.
Humm, actually, no. It makes it more complex. If marvell_hwmon_probe()
is a stub, and we keep m88e6390_hwmon_probe() as the real
implementation, it means we need m88e6390_hwmon_chip_info, so we can
pass it. Either i need a stub version of m88e6390_hwmon_chip_info, or
i just build all the hwmon code even when CONFIG_HWMON is
disabled. The compiler might be able to figure out it is all unused
and throw it away, but i doubt it.
Having m88e6390_hwmon_probe() a stub is much simpler.
Andrew
Powered by blists - more mailing lists