From: Andrew Lunn Subject: Re: [PATCH V3] net: phy: tja11xx: Add TJA11xx PHY driver Date: Sun, 23 Dec 2018 11:06:30 +0100 Message-ID: <20181223100630.GB31681@lunn.ch> References: <20181221233552.3741-1-marex@denx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marek Vasut , netdev@vger.kernel.org, Florian Fainelli To: Heiner Kallweit Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:56092 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbeLWKGb (ORCPT ); Sun, 23 Dec 2018 05:06:31 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > > + switch (attr) { > > + case hwmon_in_lcrit_alarm: > > + ret = phy_read(phydev, MII_INTSRC); > > + if (ret < 0) > > + return ret; > > + > > + *value = !!(ret & MII_INTSRC_TEMP_ERR); > > + return 0; > > + case hwmon_temp_crit_alarm: > > + ret = phy_read(phydev, MII_INTSRC); > > + if (ret < 0) > > + return ret; > > + > > + *value = !!(ret & MII_INTSRC_TEMP_ERR); > > + return 0; > > + default: > > + return -EOPNOTSUPP; > > + } > > +} > This looks like a copy & paste error, in both cases you're doing the same. You also should not do it like this. hwmon_temp_crit_alarm is in a different set of enum's as hwmon_in_lcrit_alarm. hwmon_in_lcrit_alarm = 14. hwmon_temp_max_alarm also is 14. You should have two different switch statements to take account of this. Andrew