From: Andrew Lunn <andrew@lunn.ch>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Marek Vasut <marex@denx.de>,
netdev@vger.kernel.org, Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH V3] net: phy: tja11xx: Add TJA11xx PHY driver
Date: Sun, 23 Dec 2018 11:06:30 +0100 [thread overview]
Message-ID: <20181223100630.GB31681@lunn.ch> (raw)
In-Reply-To: <ce8555e0-ef9b-5e1c-9365-c6365474edbf@gmail.com>
> > + 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
next prev parent reply other threads:[~2018-12-23 10:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-21 23:35 [PATCH V3] net: phy: tja11xx: Add TJA11xx PHY driver Marek Vasut
2018-12-22 17:39 ` Heiner Kallweit
2018-12-23 9:16 ` Marek Vasut
2018-12-23 9:41 ` Heiner Kallweit
2018-12-23 9:59 ` Andrew Lunn
2018-12-23 10:21 ` Marek Vasut
2018-12-23 10:35 ` Andrew Lunn
2018-12-23 10:48 ` Marek Vasut
2019-01-03 2:09 ` Marek Vasut
2019-01-03 6:23 ` Heiner Kallweit
2019-01-04 2:19 ` Marek Vasut
2019-01-04 2:53 ` Marek Vasut
2019-01-04 2:57 ` Florian Fainelli
2019-01-04 5:40 ` Marek Vasut
2018-12-22 20:51 ` Heiner Kallweit
2018-12-23 9:13 ` Marek Vasut
2018-12-23 10:06 ` Andrew Lunn [this message]
2018-12-23 10:49 ` Marek Vasut
2018-12-23 10:58 ` Andrew Lunn
2018-12-23 11:00 ` Marek Vasut
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181223100630.GB31681@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).