From: Dmitry Torokhov <dtor@insightbb.com>
To: linux-pm@lists.osdl.org
Cc: Andrew Morton <akpm@osdl.org>, Kay Sievers <kay.sievers@vrfy.org>,
linux-kernel@vger.kernel.org
Subject: [RFC/PATCH 1/3] Use kobject_name() to access kobject names
Date: Wed, 11 Oct 2006 02:01:39 -0400 [thread overview]
Message-ID: <20061011061030.151797574.dtor@insightbb.com> (raw)
In-Reply-To: 20061011060138.920913139.dtor@insightbb.com
[-- Attachment #1: dpm-use-kobject-name.patch --]
[-- Type: text/plain, Size: 1277 bytes --]
PM: use kobject_name() to access kobject names
Noone should use kobj.name directly since it may contain garbage.
Objects with longer names have them stored in memory pointed by
kobj->k_name.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/base/power/main.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: work/drivers/base/power/main.c
===================================================================
--- work.orig/drivers/base/power/main.c
+++ work/drivers/base/power/main.c
@@ -54,7 +54,8 @@ int device_pm_add(struct device * dev)
int error;
pr_debug("PM: Adding info for %s:%s\n",
- dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
+ dev->bus ? dev->bus->name : "No Bus",
+ kobject_name(&dev->kobj));
down(&dpm_list_sem);
list_add_tail(&dev->power.entry, &dpm_active);
device_pm_set_parent(dev, dev->parent);
@@ -67,7 +68,8 @@ int device_pm_add(struct device * dev)
void device_pm_remove(struct device * dev)
{
pr_debug("PM: Removing info for %s:%s\n",
- dev->bus ? dev->bus->name : "No Bus", dev->kobj.name);
+ dev->bus ? dev->bus->name : "No Bus",
+ kobject_name(&dev->kobj));
down(&dpm_list_sem);
dpm_sysfs_remove(dev);
put_device(dev->power.pm_parent);
next prev parent reply other threads:[~2006-10-11 6:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-11 6:01 [RFC/PATCH 0/3] Integrating struct class_device into power management framework Dmitry Torokhov
2006-10-11 6:01 ` Dmitry Torokhov [this message]
2006-10-11 6:01 ` [RFC/PATCH 2/3] Allow objects other than "struct device" in pm list Dmitry Torokhov
2007-02-28 18:24 ` David Brownell
2007-02-28 21:20 ` Dmitry Torokhov
2007-02-28 21:59 ` David Brownell
2007-02-28 22:07 ` Dmitry Torokhov
2006-10-11 6:01 ` [RFC/PATCH 3/3] add class_devices to power management list Dmitry Torokhov
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=20061011061030.151797574.dtor@insightbb.com \
--to=dtor@insightbb.com \
--cc=akpm@osdl.org \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.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