Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41174
b: refs/heads/master
c: b9cafc7
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Greg Kroah-Hartman committed Dec 1, 2006
1 parent 1366a4e commit 8ec7ebb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 40fa54226f518a9bc97ed1d711c0016e416e3782
refs/heads/master: b9cafc7d5b8af0c71896f60dfcff40c71bd38a9a
20 changes: 17 additions & 3 deletions trunk/drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,21 @@ static void device_remove_attrs(struct bus_type * bus, struct device * dev)
}
}

#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
Expand All @@ -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;
}
Expand Down Expand Up @@ -436,7 +450,7 @@ void bus_remove_device(struct device * dev)
{
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) {
Expand Down

0 comments on commit 8ec7ebb

Please sign in to comment.