Discussion:
[CFT 12/29] Add sh_bus_type probe and remove methods
Russell King
2006-01-05 14:35:42 UTC
Permalink
Signed-off-by: Russell King <rmk+***@arm.linux.org.uk>

---
arch/sh/kernel/cpu/bus.c | 34 +++++++++++++++++-----------------
1 files changed, 17 insertions(+), 17 deletions(-)

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git linus/arch/sh/kernel/cpu/bus.c linux/arch/sh/kernel/cpu/bus.c
--- linus/arch/sh/kernel/cpu/bus.c Sun Nov 6 22:14:58 2005
+++ linux/arch/sh/kernel/cpu/bus.c Sun Nov 13 16:11:45 2005
@@ -53,21 +53,6 @@ static int sh_bus_resume(struct device *
return 0;
}

-static struct device sh_bus_devices[SH_NR_BUSES] = {
- {
- .bus_id = SH_BUS_NAME_VIRT,
- },
-};
-
-struct bus_type sh_bus_types[SH_NR_BUSES] = {
- {
- .name = SH_BUS_NAME_VIRT,
- .match = sh_bus_match,
- .suspend = sh_bus_suspend,
- .resume = sh_bus_resume,
- },
-};
-
static int sh_device_probe(struct device *dev)
{
struct sh_dev *shdev = to_sh_dev(dev);
@@ -90,6 +75,23 @@ static int sh_device_remove(struct devic
return 0;
}

+static struct device sh_bus_devices[SH_NR_BUSES] = {
+ {
+ .bus_id = SH_BUS_NAME_VIRT,
+ },
+};
+
+struct bus_type sh_bus_types[SH_NR_BUSES] = {
+ {
+ .name = SH_BUS_NAME_VIRT,
+ .match = sh_bus_match,
+ .probe = sh_bus_probe,
+ .remove = sh_bus_remove,
+ .suspend = sh_bus_suspend,
+ .resume = sh_bus_resume,
+ },
+};
+
int sh_device_register(struct sh_dev *dev)
{
if (!dev)
@@ -133,8 +135,6 @@ int sh_driver_register(struct sh_driver
return -EINVAL;
}

- drv->drv.probe = sh_device_probe;
- drv->drv.remove = sh_device_remove;
drv->drv.bus = &sh_bus_types[drv->bus_id];

return driver_register(&drv->drv);
Russell King
2006-01-05 14:42:40 UTC
Permalink
Signed-off-by: Russell King <rmk+***@arm.linux.org.uk>

---
drivers/sh/superhyway/superhyway.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk -x *.orig -x *.rej -x .git linus/drivers/sh/superhyway/superhyway.c linux/drivers/sh/superhyway/superhyway.c
--- linus/drivers/sh/superhyway/superhyway.c Mon Nov 7 19:58:05 2005
+++ linux/drivers/sh/superhyway/superhyway.c Sun Nov 13 16:38:04 2005
@@ -175,8 +175,6 @@ int superhyway_register_driver(struct su
{
drv->drv.name = drv->name;
drv->drv.bus = &superhyway_bus_type;
- drv->drv.probe = superhyway_device_probe;
- drv->drv.remove = superhyway_device_remove;

return driver_register(&drv->drv);
}
@@ -213,6 +211,8 @@ struct bus_type superhyway_bus_type = {
#ifdef CONFIG_SYSFS
.dev_attrs = superhyway_dev_attrs,
#endif
+ .probe = superhyway_device_probe,
+ .remove = superhyway_device_remove,
};

static int __init superhyway_bus_init(void)

Loading...