diff options
author | Mark McLoughlin <markmc@redhat.com> | 2008-06-13 08:46:40 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-07-24 22:06:05 -0400 |
commit | e962fa660d391fc9b90988e6538c94c858c099f9 (patch) | |
tree | 2e498cb10c9a416192c769bec8119455afcb18ba | |
parent | 44653eae1407f79dff6f52fcf594ae84cb165ec4 (diff) |
virtio: Use bus_type probe and remove methods
Hook up to the probe() and remove() methods in bus_type
rather than device_driver. The latter has been preferred
since 2.6.16.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | drivers/virtio/virtio.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 7084e7e146c0..fc85cba64578 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c | |||
@@ -71,13 +71,6 @@ static int virtio_uevent(struct device *_dv, struct kobj_uevent_env *env) | |||
71 | dev->id.device, dev->id.vendor); | 71 | dev->id.device, dev->id.vendor); |
72 | } | 72 | } |
73 | 73 | ||
74 | static struct bus_type virtio_bus = { | ||
75 | .name = "virtio", | ||
76 | .match = virtio_dev_match, | ||
77 | .dev_attrs = virtio_dev_attrs, | ||
78 | .uevent = virtio_uevent, | ||
79 | }; | ||
80 | |||
81 | static void add_status(struct virtio_device *dev, unsigned status) | 74 | static void add_status(struct virtio_device *dev, unsigned status) |
82 | { | 75 | { |
83 | dev->config->set_status(dev, dev->config->get_status(dev) | status); | 76 | dev->config->set_status(dev, dev->config->get_status(dev) | status); |
@@ -147,13 +140,20 @@ static int virtio_dev_remove(struct device *_d) | |||
147 | return 0; | 140 | return 0; |
148 | } | 141 | } |
149 | 142 | ||
143 | static struct bus_type virtio_bus = { | ||
144 | .name = "virtio", | ||
145 | .match = virtio_dev_match, | ||
146 | .dev_attrs = virtio_dev_attrs, | ||
147 | .uevent = virtio_uevent, | ||
148 | .probe = virtio_dev_probe, | ||
149 | .remove = virtio_dev_remove, | ||
150 | }; | ||
151 | |||
150 | int register_virtio_driver(struct virtio_driver *driver) | 152 | int register_virtio_driver(struct virtio_driver *driver) |
151 | { | 153 | { |
152 | /* Catch this early. */ | 154 | /* Catch this early. */ |
153 | BUG_ON(driver->feature_table_size && !driver->feature_table); | 155 | BUG_ON(driver->feature_table_size && !driver->feature_table); |
154 | driver->driver.bus = &virtio_bus; | 156 | driver->driver.bus = &virtio_bus; |
155 | driver->driver.probe = virtio_dev_probe; | ||
156 | driver->driver.remove = virtio_dev_remove; | ||
157 | return driver_register(&driver->driver); | 157 | return driver_register(&driver->driver); |
158 | } | 158 | } |
159 | EXPORT_SYMBOL_GPL(register_virtio_driver); | 159 | EXPORT_SYMBOL_GPL(register_virtio_driver); |