> > + 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