All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (lineage-pem): Fix in1 voltage
Date: Wed, 16 Mar 2011 13:51:10 +0000	[thread overview]
Message-ID: <20110316135110.GA26778@ericsson.com> (raw)
In-Reply-To: <1300233149-2269-1-git-send-email-guenter.roeck@ericsson.com>

Hi Jean,

On Wed, Mar 16, 2011 at 04:26:49AM -0400, Jean Delvare wrote:
> On Tue, 15 Mar 2011 16:52:29 -0700, Guenter Roeck wrote:
> > The alarm bit assumed to be a low voltage alarm bit is not set for low voltage
> > alarms, and the alarm bit assumed to be a high voltage alarm turns out to be a
> > general alarm bit which is set for both low and high voltage alarms.
> > 
> > Remove the in1_min_alarm sysfs attribute and rename in1_max_alarm to in1_alarm
> > to reflect the situation.
> > 
> > Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> > ---
> >  drivers/hwmon/lineage-pem.c |    7 ++-----
> >  1 files changed, 2 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/hwmon/lineage-pem.c b/drivers/hwmon/lineage-pem.c
> > index 2fe8e9e..ab63650 100644
> > --- a/drivers/hwmon/lineage-pem.c
> > +++ b/drivers/hwmon/lineage-pem.c
> > @@ -345,9 +345,7 @@ static ssize_t pem_show_fan(struct device *dev, struct device_attribute *da,
> >  /* Voltages */
> >  static SENSOR_DEVICE_ATTR(in1_input, S_IRUGO, pem_show_data, NULL,
> >  			  PEM_DATA_VOUT_LSB);
> > -static SENSOR_DEVICE_ATTR_2(in1_min_alarm, S_IRUGO, pem_show_bool, NULL,
> > -			    PEM_DATA_ALARM_2, ALRM2_OV_LOW);
> > -static SENSOR_DEVICE_ATTR_2(in1_max_alarm, S_IRUGO, pem_show_bool, NULL,
> > +static SENSOR_DEVICE_ATTR_2(in1_alarm, S_IRUGO, pem_show_bool, NULL,
> >  			    PEM_DATA_ALARM_1, ALRM1_VOUT_OUT_LIMIT);
> >  static SENSOR_DEVICE_ATTR_2(in1_crit_alarm, S_IRUGO, pem_show_bool, NULL,
> >  			    PEM_DATA_ALARM_1, ALRM1_OV_VOLT_SHUTDOWN);
> > @@ -395,8 +393,7 @@ static SENSOR_DEVICE_ATTR_2(temp1_fault, S_IRUGO, pem_show_bool, NULL,
> >  
> >  static struct attribute *pem_attributes[] = {
> >  	&sensor_dev_attr_in1_input.dev_attr.attr,
> > -	&sensor_dev_attr_in1_min_alarm.dev_attr.attr,
> > -	&sensor_dev_attr_in1_max_alarm.dev_attr.attr,
> > +	&sensor_dev_attr_in1_alarm.dev_attr.attr,
> >  	&sensor_dev_attr_in1_crit_alarm.dev_attr.attr,
> >  	&sensor_dev_attr_in2_alarm.dev_attr.attr,
> >  
> 
> Looks good.
> 
> Acked-by: Jean Delvare <khali@linux-fr.org>
> 
> Note that this means that this device has now in1_alarm and
> in1_crit_alarm. This is a case your proposed rewrite of the "sensors"
> code won't properly deal with, as it will only check for limit-specific
> alarm flags in the absence of a generic alarm flag (so in this case
> in1_crit_alarm will be ignored.) Not that the original code was better,
> but maybe it's the right time to get it right.
> 
Yes, I know :(. I didn't want to get rid of the _crit attribute, since it is
supported and adds value. Figured I'd deal with the sensors problem later 
(if I find a good solution).

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2011-03-16 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 23:52 [lm-sensors] [PATCH] hwmon: (lineage-pem): Fix in1 voltage alarm Guenter Roeck
2011-03-16  8:26 ` [lm-sensors] [PATCH] hwmon: (lineage-pem): Fix in1 voltage Jean Delvare
2011-03-16 13:51 ` Guenter Roeck [this message]
2011-03-16 14:06 ` Jean Delvare

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=20110316135110.GA26778@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=lm-sensors@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.