From: Wolfram Sang <w.sang@pengutronix.de>
To: linux-kernel@vger.kernel.org
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Wolfram Sang <w.sang@pengutronix.de>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Greg KH <gregkh@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Zhang Rui <rui.zhang@intel.com>, Len Brown <len.brown@intel.com>,
Matthew Garrett <mjg@redhat.com>, Frans Pop <elendil@planet.nl>
Subject: [PATCH 1/2] Fix 'key f70f4b50 not in .data' in thermal_sys
Date: Fri, 2 Apr 2010 03:02:14 +0200 [thread overview]
Message-ID: <1270170140-325-1-git-send-email-w.sang@pengutronix.de> (raw)
From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Initialize sysfs attributes before device_create_file call. Fixes
Bug #15548.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Greg KH <gregkh@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
drivers/thermal/thermal_sys.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 5066de5..ecb181d 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -505,6 +505,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
tz->temp_input.attr.attr.name = tz->temp_input.name;
tz->temp_input.attr.attr.mode = 0444;
tz->temp_input.attr.show = temp_input_show;
+ sysfs_attr_init(&tz->temp_input.attr.attr);
result = device_create_file(hwmon->device, &tz->temp_input.attr);
if (result)
goto unregister_hwmon_device;
@@ -517,6 +518,7 @@ thermal_add_hwmon_sysfs(struct thermal_zone_device *tz)
tz->temp_crit.attr.attr.name = tz->temp_crit.name;
tz->temp_crit.attr.attr.mode = 0444;
tz->temp_crit.attr.show = temp_crit_show;
+ sysfs_attr_init(&tz->temp_crit.attr.attr);
result = device_create_file(hwmon->device,
&tz->temp_crit.attr);
if (result)
@@ -725,6 +727,7 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
goto release_idr;
sprintf(dev->attr_name, "cdev%d_trip_point", dev->id);
+ sysfs_attr_init(&dev->attr.attr);
dev->attr.attr.name = dev->attr_name;
dev->attr.attr.mode = 0444;
dev->attr.show = thermal_cooling_device_trip_point_show;
--
1.7.0
next reply other threads:[~2010-04-02 1:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-02 1:02 Wolfram Sang [this message]
2010-04-02 1:02 ` [PATCH 2/2] device_attributes: add sysfs_attr_init() for dynamic attributes Wolfram Sang
2010-04-08 22:55 ` Mauro Carvalho Chehab
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=1270170140-325-1-git-send-email-w.sang@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=elendil@planet.nl \
--cc=gregkh@suse.de \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=rui.zhang@intel.com \
--cc=sergey.senozhatsky@gmail.com \
/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
all inboxes | Powered by JetHome®