diff options
author | Russell King <rmk@arm.linux.org.uk> | 2006-01-05 09:37:50 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-13 14:26:07 -0500 |
commit | b864c7d5d17c171c4ead0791b44ab05d7a21dc0c (patch) | |
tree | f9822f71b07920f819c3282084fa2831fc6d7458 | |
parent | 5b34bf88779fa965a134b92ab61688e0d1ddfe1d (diff) |
[PATCH] Add i2c_bus_type probe and remove methods
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/i2c/i2c-core.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 52b77477df57..0ce58b506046 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -63,13 +63,6 @@ static int i2c_bus_resume(struct device * dev) | |||
63 | return rc; | 63 | return rc; |
64 | } | 64 | } |
65 | 65 | ||
66 | struct bus_type i2c_bus_type = { | ||
67 | .name = "i2c", | ||
68 | .match = i2c_device_match, | ||
69 | .suspend = i2c_bus_suspend, | ||
70 | .resume = i2c_bus_resume, | ||
71 | }; | ||
72 | |||
73 | static int i2c_device_probe(struct device *dev) | 66 | static int i2c_device_probe(struct device *dev) |
74 | { | 67 | { |
75 | return -ENODEV; | 68 | return -ENODEV; |
@@ -80,6 +73,15 @@ static int i2c_device_remove(struct device *dev) | |||
80 | return 0; | 73 | return 0; |
81 | } | 74 | } |
82 | 75 | ||
76 | struct bus_type i2c_bus_type = { | ||
77 | .name = "i2c", | ||
78 | .match = i2c_device_match, | ||
79 | .probe = i2c_device_probe, | ||
80 | .remove = i2c_device_remove, | ||
81 | .suspend = i2c_bus_suspend, | ||
82 | .resume = i2c_bus_resume, | ||
83 | }; | ||
84 | |||
83 | void i2c_adapter_dev_release(struct device *dev) | 85 | void i2c_adapter_dev_release(struct device *dev) |
84 | { | 86 | { |
85 | struct i2c_adapter *adap = dev_to_i2c_adapter(dev); | 87 | struct i2c_adapter *adap = dev_to_i2c_adapter(dev); |
@@ -90,8 +92,6 @@ struct device_driver i2c_adapter_driver = { | |||
90 | .owner = THIS_MODULE, | 92 | .owner = THIS_MODULE, |
91 | .name = "i2c_adapter", | 93 | .name = "i2c_adapter", |
92 | .bus = &i2c_bus_type, | 94 | .bus = &i2c_bus_type, |
93 | .probe = i2c_device_probe, | ||
94 | .remove = i2c_device_remove, | ||
95 | }; | 95 | }; |
96 | 96 | ||
97 | static void i2c_adapter_class_dev_release(struct class_device *dev) | 97 | static void i2c_adapter_class_dev_release(struct class_device *dev) |
@@ -294,8 +294,6 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver) | |||
294 | /* add the driver to the list of i2c drivers in the driver core */ | 294 | /* add the driver to the list of i2c drivers in the driver core */ |
295 | driver->driver.owner = owner; | 295 | driver->driver.owner = owner; |
296 | driver->driver.bus = &i2c_bus_type; | 296 | driver->driver.bus = &i2c_bus_type; |
297 | driver->driver.probe = i2c_device_probe; | ||
298 | driver->driver.remove = i2c_device_remove; | ||
299 | 297 | ||
300 | res = driver_register(&driver->driver); | 298 | res = driver_register(&driver->driver); |
301 | if (res) | 299 | if (res) |