From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next] net: phy: marvell: mv88e6390 temperature sensor reading Date: Wed, 10 Jan 2018 15:05:59 +0100 Message-ID: <20180110140559.GB32117@lunn.ch> References: <1515534129-13399-1-git-send-email-andrew@lunn.ch> <4033cdd4-36ae-060d-57f3-f8def0598024@gmail.com> <20180110135224.GA32117@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Miller , netdev To: Florian Fainelli Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:36412 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933797AbeAJOGB (ORCPT ); Wed, 10 Jan 2018 09:06:01 -0500 Content-Disposition: inline In-Reply-To: <20180110135224.GA32117@lunn.ch> Sender: netdev-owner@vger.kernel.org List-ID: > > > +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