Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b9cafc7d5b8af0c71896f60dfcff40c71bd38a9a
Commit:     b9cafc7d5b8af0c71896f60dfcff40c71bd38a9a
Parent:     40fa54226f518a9bc97ed1d711c0016e416e3782
Author:     Kay Sievers <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 14 11:23:28 2006 +0200
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Dec 1 14:51:58 2006 -0800

    CONFIG_SYSFS_DEPRECATED - bus symlinks
    
    Turn off the bus symlinks if CONFIG_SYSFS_DEPRECATED is enabled
    
    Signed-off-by: Kay Sievers <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/base/bus.c |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index ed3e8a2..472810f 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -355,6 +355,21 @@ static void device_remove_attrs(struct b
        }
 }
 
+#ifdef CONFIG_SYSFS_DEPRECATED
+static int make_deprecated_bus_links(struct device *dev)
+{
+       return sysfs_create_link(&dev->kobj,
+                                &dev->bus->subsys.kset.kobj, "bus");
+}
+
+static void remove_deprecated_bus_links(struct device *dev)
+{
+       sysfs_remove_link(&dev->kobj, "bus");
+}
+#else
+static inline int make_deprecated_bus_links(struct device *dev) { return 0; }
+static inline void remove_deprecated_bus_links(struct device *dev) { }
+#endif
 
 /**
  *     bus_add_device - add device to bus
@@ -381,8 +396,7 @@ int bus_add_device(struct device * dev)
                                &dev->bus->subsys.kset.kobj, "subsystem");
                if (error)
                        goto out_subsys;
-               error = sysfs_create_link(&dev->kobj,
-                               &dev->bus->subsys.kset.kobj, "bus");
+               error = make_deprecated_bus_links(dev);
                if (error)
                        goto out_deprecated;
        }
@@ -436,7 +450,7 @@ void bus_remove_device(struct device * d
 {
        if (dev->bus) {
                sysfs_remove_link(&dev->kobj, "subsystem");
-               sysfs_remove_link(&dev->kobj, "bus");
+               remove_deprecated_bus_links(dev);
                sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id);
                device_remove_attrs(dev->bus, dev);
                if (dev->is_registered) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to