From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: Re: [PATCH net-next] net: phy: marvell: mv88e6390 temperature sensor reading Date: Wed, 10 Jan 2018 09:49:03 -0800 Message-ID: <7eb569f8-ad27-3a28-17e9-461bf9acd1af@gmail.com> References: <1515534129-13399-1-git-send-email-andrew@lunn.ch> <4033cdd4-36ae-060d-57f3-f8def0598024@gmail.com> <20180110135224.GA32117@lunn.ch> <20180110140559.GB32117@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: David Miller , netdev To: Andrew Lunn Return-path: Received: from mail-qk0-f195.google.com ([209.85.220.195]:40735 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751868AbeAJRtH (ORCPT ); Wed, 10 Jan 2018 12:49:07 -0500 Received: by mail-qk0-f195.google.com with SMTP id d18so13566853qke.7 for ; Wed, 10 Jan 2018 09:49:06 -0800 (PST) In-Reply-To: <20180110140559.GB32117@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/10/2018 06:05 AM, Andrew Lunn wrote: >>>> +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. Fair enough: Reviewed-by: Florian Fainelli -- Florian