]> err.no Git - linux-2.6/commit
driver core: Allow device_move(dev, NULL).
authorCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 8 Jan 2007 19:16:44 +0000 (20:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Feb 2007 18:37:11 +0000 (10:37 -0800)
commitc744aeae9d173a953b771a7ad5c872f91fa99dec
tree83d36e211ff6d0109f3aeb29d4fd1bb2dbb2a9b3
parent717e48c29d9a58f4d31c1651bec364212da5f6b2
driver core: Allow device_move(dev, NULL).

If we allow NULL as the new parent in device_move(), we need to make sure
that the device is placed into the same place as it would if it was
newly registered:

- Consider the device virtual tree. In order to be able to reuse code,
  setup_parent() has been tweaked a bit.
- kobject_move() can fall back to the kset's kobject.
- sysfs_move_dir() uses the sysfs root dir as fallback.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c
fs/sysfs/dir.c
lib/kobject.c