diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-11-15 17:13:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-17 17:21:08 -0500 |
commit | 6b6e39a6a8da7234c538d14c43d3583da8875f9c (patch) | |
tree | cef5d25998665559ecc0cad2bcdb947cfa401b67 /drivers/base/bus.c | |
parent | 14c05aa399e30f343f25158c9adfc44631378a96 (diff) |
driver-core: merge private parts of class and bus
As classes and busses are pretty much the same thing, and we want to
merge them together into a 'subsystem' in the future, let us share the
same private data parts to make that merge easier.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r-- | drivers/base/bus.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index 33c270a64db7..e243bd49764b 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include "power/power.h" | 20 | #include "power/power.h" |
21 | 21 | ||
22 | #define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) | 22 | #define to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) |
23 | #define to_bus(obj) container_of(obj, struct bus_type_private, subsys.kobj) | ||
24 | 23 | ||
25 | /* | 24 | /* |
26 | * sysfs bindings for drivers | 25 | * sysfs bindings for drivers |
@@ -96,11 +95,11 @@ static ssize_t bus_attr_show(struct kobject *kobj, struct attribute *attr, | |||
96 | char *buf) | 95 | char *buf) |
97 | { | 96 | { |
98 | struct bus_attribute *bus_attr = to_bus_attr(attr); | 97 | struct bus_attribute *bus_attr = to_bus_attr(attr); |
99 | struct bus_type_private *bus_priv = to_bus(kobj); | 98 | struct subsys_private *subsys_priv = to_subsys_private(kobj); |
100 | ssize_t ret = 0; | 99 | ssize_t ret = 0; |
101 | 100 | ||
102 | if (bus_attr->show) | 101 | if (bus_attr->show) |
103 | ret = bus_attr->show(bus_priv->bus, buf); | 102 | ret = bus_attr->show(subsys_priv->bus, buf); |
104 | return ret; | 103 | return ret; |
105 | } | 104 | } |
106 | 105 | ||
@@ -108,11 +107,11 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr, | |||
108 | const char *buf, size_t count) | 107 | const char *buf, size_t count) |
109 | { | 108 | { |
110 | struct bus_attribute *bus_attr = to_bus_attr(attr); | 109 | struct bus_attribute *bus_attr = to_bus_attr(attr); |
111 | struct bus_type_private *bus_priv = to_bus(kobj); | 110 | struct subsys_private *subsys_priv = to_subsys_private(kobj); |
112 | ssize_t ret = 0; | 111 | ssize_t ret = 0; |
113 | 112 | ||
114 | if (bus_attr->store) | 113 | if (bus_attr->store) |
115 | ret = bus_attr->store(bus_priv->bus, buf, count); | 114 | ret = bus_attr->store(subsys_priv->bus, buf, count); |
116 | return ret; | 115 | return ret; |
117 | } | 116 | } |
118 | 117 | ||
@@ -858,9 +857,9 @@ static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store); | |||
858 | int bus_register(struct bus_type *bus) | 857 | int bus_register(struct bus_type *bus) |
859 | { | 858 | { |
860 | int retval; | 859 | int retval; |
861 | struct bus_type_private *priv; | 860 | struct subsys_private *priv; |
862 | 861 | ||
863 | priv = kzalloc(sizeof(struct bus_type_private), GFP_KERNEL); | 862 | priv = kzalloc(sizeof(struct subsys_private), GFP_KERNEL); |
864 | if (!priv) | 863 | if (!priv) |
865 | return -ENOMEM; | 864 | return -ENOMEM; |
866 | 865 | ||