driver core: Introduce device_move(): move a device to a new parent.

Provide a function device_move() to move a device to a new parent device. Add
auxilliary functions kobject_move() and sysfs_move_dir().
kobject_move() generates a new uevent of type KOBJ_MOVE, containing the
previous path (DEVPATH_OLD) in addition to the usual values. For this, a new
interface kobject_uevent_env() is created that allows to add further
environmental data to the uevent at the kobject layer.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Cornelia Huck 2006-11-20 17:07:51 +01:00 committed by Greg Kroah-Hartman
parent af9e076536
commit 8a82472f86
7 changed files with 228 additions and 4 deletions

View file

@ -96,6 +96,9 @@ sysfs_remove_dir(struct kobject *);
extern int __must_check
sysfs_rename_dir(struct kobject *, const char *new_name);
extern int __must_check
sysfs_move_dir(struct kobject *, struct kobject *);
extern int __must_check
sysfs_create_file(struct kobject *, const struct attribute *);
@ -142,6 +145,11 @@ static inline int sysfs_rename_dir(struct kobject * k, const char *new_name)
return 0;
}
static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent)
{
return 0;
}
static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
{
return 0;