aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2008-05-27 19:31:11 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-27 19:31:11 -0700
commit3bbc41681338166def698776412eaa24a69ecb5c (patch)
tree28f5510f61c2f3d121d82770eec8bafc176a60b7
parente941db6865c88cbeef204023f418ed76ac869086 (diff)
downloadpatches-3bbc41681338166def698776412eaa24a69ecb5c.tar.gz
handle config_sysfs_deprecated properly
-rw-r--r--class-move-driver-core-specific-parts-to-a-private-structure.patch50
1 files changed, 44 insertions, 6 deletions
diff --git a/class-move-driver-core-specific-parts-to-a-private-structure.patch b/class-move-driver-core-specific-parts-to-a-private-structure.patch
index ab0ec062256888..be085583a8d4da 100644
--- a/class-move-driver-core-specific-parts-to-a-private-structure.patch
+++ b/class-move-driver-core-specific-parts-to-a-private-structure.patch
@@ -15,9 +15,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/base/base.h | 27 ++++++++++++++
drivers/base/class.c | 89 ++++++++++++++++++++++++++-----------------------
- drivers/base/core.c | 41 ++++++++++++----------
+ drivers/base/core.c | 57 ++++++++++++++++---------------
include/linux/device.h | 8 +---
- 4 files changed, 101 insertions(+), 64 deletions(-)
+ 4 files changed, 109 insertions(+), 72 deletions(-)
--- a/drivers/base/base.h
+++ b/drivers/base/base.h
@@ -280,6 +280,15 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
}
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
+@@ -552,7 +552,7 @@ static struct kobject *get_device_parent
+ {
+ /* class devices without a parent live in /sys/class/<classname>/ */
+ if (dev->class && (!parent || parent->class != dev->class))
+- return &dev->class->subsys.kobj;
++ return &dev->class->p->subsys.kobj;
+ /* all other devices keep their parent */
+ else if (parent)
+ return &parent->kobj;
@@ -598,13 +598,13 @@ static struct kobject *get_device_parent
parent_kobj = &parent->kobj;
@@ -315,7 +324,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return;
kobject_put(glue_dir);
-@@ -658,7 +658,7 @@ static int device_add_class_symlinks(str
+@@ -658,17 +658,17 @@ static int device_add_class_symlinks(str
if (!dev->class)
return 0;
@@ -324,8 +333,28 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
"subsystem");
if (error)
goto out;
-@@ -710,7 +710,7 @@ out_busid:
- sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
+
+ #ifdef CONFIG_SYSFS_DEPRECATED
+ /* stacked class devices need a symlink in the class directory */
+- if (dev->kobj.parent != &dev->class->subsys.kobj &&
++ if (dev->kobj.parent != &dev->class->p->subsys.kobj &&
+ device_is_not_partition(dev)) {
+- error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
+- dev->bus_id);
++ error = sysfs_create_link(&dev->class->p->subsys.kobj,
++ &dev->kobj, dev->bus_id);
+ if (error)
+ goto out_subsys;
+ }
+@@ -705,12 +705,12 @@ out_device:
+ if (dev->parent && device_is_not_partition(dev))
+ sysfs_remove_link(&dev->kobj, "device");
+ out_busid:
+- if (dev->kobj.parent != &dev->class->subsys.kobj &&
++ if (dev->kobj.parent != &dev->class->p->subsys.kobj &&
+ device_is_not_partition(dev))
+- sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
++ sysfs_remove_link(&dev->class->p->subsys.kobj, dev->bus_id);
#else
/* link in the class directory pointing to the device */
- error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
@@ -342,7 +371,16 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
#endif
out_subsys:
-@@ -757,7 +757,7 @@ static void device_remove_class_symlinks
+@@ -750,14 +750,14 @@ static void device_remove_class_symlinks
+ sysfs_remove_link(&dev->kobj, "device");
+ }
+
+- if (dev->kobj.parent != &dev->class->subsys.kobj &&
++ if (dev->kobj.parent != &dev->class->p->subsys.kobj &&
+ device_is_not_partition(dev))
+- sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
++ sysfs_remove_link(&dev->class->p->subsys.kobj, dev->bus_id);
+ #else
if (dev->parent && device_is_not_partition(dev))
sysfs_remove_link(&dev->kobj, "device");