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: Tue, 9 Jan 2018 16:14:44 -0800 Message-ID: <4033cdd4-36ae-060d-57f3-f8def0598024@gmail.com> References: <1515534129-13399-1-git-send-email-andrew@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev To: Andrew Lunn , David Miller Return-path: Received: from mail-qk0-f175.google.com ([209.85.220.175]:39847 "EHLO mail-qk0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752677AbeAJAOs (ORCPT ); Tue, 9 Jan 2018 19:14:48 -0500 Received: by mail-qk0-f175.google.com with SMTP id r8so16564167qke.6 for ; Tue, 09 Jan 2018 16:14:47 -0800 (PST) In-Reply-To: <1515534129-13399-1-git-send-email-andrew@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 01/09/2018 01:42 PM, Andrew Lunn wrote: > The internal PHYs in the mv88e6390 switch have a temperature sensor. > It uses a different register layout to other PHY currently supported. > It also has an errata, in that some reads of the sensor result in bad > values. So a number of reads need to be made, and the average taken. > > Signed-off-by: Andrew Lunn Just a few nits below: [snip] > +static int m88e6390_hwmon_read(struct device *dev, > + enum hwmon_sensor_types type, > + u32 attr, int channel, long *temp) > +{ > + struct phy_device *phydev = dev_get_drvdata(dev); Why not to_phy_device()? [snip] > + > +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? -- Florian