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 5/5] hwmon: (s3c) Initialize sysfs
Date: Sat, 11 Jun 2011 16:11:05 +0000	[thread overview]
Message-ID: <20110611161105.GC26406@ericsson.com> (raw)
In-Reply-To: <1306267814-31505-6-git-send-email-guenter.roeck@ericsson.com>

On Sat, Jun 11, 2011 at 06:01:49AM -0400, Jean Delvare wrote:
> Hi Guenter,
> 
> On Tue, 24 May 2011 13:10:14 -0700, Guenter Roeck wrote:
> > Initialize dynamically allocated sysfs attributes before device_create_file()
> > call to suppress lockdep_init_map() warning if lockdep debugging is enabled.
> > 
> > Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
> > ---
> > Compile tested only.
> 
> Seems incomplete to me...
> 
> > 
> >  drivers/hwmon/s3c-hwmon.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
> > index 92b42db..731d1f3 100644
> > --- a/drivers/hwmon/s3c-hwmon.c
> > +++ b/drivers/hwmon/s3c-hwmon.c
> > @@ -232,6 +232,7 @@ static int s3c_hwmon_create_attr(struct device *dev,
> >  
> >  	attr = &attrs->in;
> >  	attr->index = channel;
> > +	sysfs_attr_init(&attr->dev_attr.attr);
> >  	attr->dev_attr.attr.name  = attrs->in_name;
> >  	attr->dev_attr.attr.mode  = S_IRUGO;
> >  	attr->dev_attr.show = s3c_hwmon_ch_show;
> 
> A few lines below, a second optional attribute is used for the label.
> So you also need:
> 
> --- linux-3.0-rc2.orig/drivers/hwmon/s3c-hwmon.c	2011-06-11 11:51:17.000000000 +0200
> +++ linux-3.0-rc2/drivers/hwmon/s3c-hwmon.c	2011-06-11 11:51:14.000000000 +0200
> @@ -250,6 +250,7 @@ static int s3c_hwmon_create_attr(struct
>  
>  		attr = &attrs->label;
>  		attr->index = channel;
> +		sysfs_attr_init(&attr->dev_attr.attr);
>  		attr->dev_attr.attr.name  = attrs->label_name;
>  		attr->dev_attr.attr.mode  = S_IRUGO;
>  		attr->dev_attr.show = s3c_hwmon_label_show;
> 
> (Not even build-tested, but that should work.)
> 
> With this change added:
> 
> Acked-by: Jean Delvare <khali@linux-fr.org>
> 
Good catch, fixed, applied, and added Cc: for stable.

> Thanks for finally fixing all these warnings, BTW, they've been there
> for quite some time...
> 
Yes, I figured since I was looking into the problem anyway after it was found
in the coretemp driver, I should spend the time to track it down everywhere ...
I just hope I found all instances.

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-06-11 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 19:48 [lm-sensors] [PATCH 5/5] hwmon: (s3c) Initialize sysfs attributes Guenter Roeck
2011-06-11 10:01 ` [lm-sensors] [PATCH 5/5] hwmon: (s3c) Initialize sysfs Jean Delvare
2011-06-11 16:11 ` Guenter Roeck [this message]

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=20110611161105.GC26406@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.