diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-07-03 03:43:34 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-07-03 03:43:34 -0700 |
| commit | e956d3ab2a9fd0387d41f5035e0902e06bcbc219 (patch) | |
| tree | 91d4f7add711204af05ef470da10388da713ca9c /lib/kobject.c | |
| parent | f91c01ac74c4970d1d31324d6e80d78aaceae2b8 (diff) | |
[PATCH] kobject: add kobject_rename()
Based on a patch written by Dan Aloni <da-x@gmx.net>
Diffstat (limited to 'lib/kobject.c')
| -rw-r--r-- | lib/kobject.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index fb49131f5ff9..15fa0ba4dd88 100644 --- a/lib/kobject.c +++ b/lib/kobject.c @@ -314,6 +314,21 @@ int kobject_register(struct kobject * kobj) } /** + * kobject_rename - change the name of an object + * @kobj: object in question. + * @new_name: object's new name + */ + +void kobject_rename(struct kobject * kobj, char *new_name) +{ + kobj = kobject_get(kobj); + if (!kobj) + return; + sysfs_rename_dir(kobj, new_name); + kobject_put(kobj); +} + +/** * kobject_del - unlink kobject from hierarchy. * @kobj: object. */ |
