diff options
Diffstat (limited to 'arch/sh/kernel/cpu/bus.c')
-rw-r--r-- | arch/sh/kernel/cpu/bus.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/sh/kernel/cpu/bus.c b/arch/sh/kernel/cpu/bus.c index d4fee2a79373..fc6c4bd40c65 100644 --- a/arch/sh/kernel/cpu/bus.c +++ b/arch/sh/kernel/cpu/bus.c | |||
@@ -53,21 +53,6 @@ static int sh_bus_resume(struct device *dev) | |||
53 | return 0; | 53 | return 0; |
54 | } | 54 | } |
55 | 55 | ||
56 | static struct device sh_bus_devices[SH_NR_BUSES] = { | ||
57 | { | ||
58 | .bus_id = SH_BUS_NAME_VIRT, | ||
59 | }, | ||
60 | }; | ||
61 | |||
62 | struct bus_type sh_bus_types[SH_NR_BUSES] = { | ||
63 | { | ||
64 | .name = SH_BUS_NAME_VIRT, | ||
65 | .match = sh_bus_match, | ||
66 | .suspend = sh_bus_suspend, | ||
67 | .resume = sh_bus_resume, | ||
68 | }, | ||
69 | }; | ||
70 | |||
71 | static int sh_device_probe(struct device *dev) | 56 | static int sh_device_probe(struct device *dev) |
72 | { | 57 | { |
73 | struct sh_dev *shdev = to_sh_dev(dev); | 58 | struct sh_dev *shdev = to_sh_dev(dev); |
@@ -90,6 +75,23 @@ static int sh_device_remove(struct device *dev) | |||
90 | return 0; | 75 | return 0; |
91 | } | 76 | } |
92 | 77 | ||
78 | static struct device sh_bus_devices[SH_NR_BUSES] = { | ||
79 | { | ||
80 | .bus_id = SH_BUS_NAME_VIRT, | ||
81 | }, | ||
82 | }; | ||
83 | |||
84 | struct bus_type sh_bus_types[SH_NR_BUSES] = { | ||
85 | { | ||
86 | .name = SH_BUS_NAME_VIRT, | ||
87 | .match = sh_bus_match, | ||
88 | .probe = sh_bus_probe, | ||
89 | .remove = sh_bus_remove, | ||
90 | .suspend = sh_bus_suspend, | ||
91 | .resume = sh_bus_resume, | ||
92 | }, | ||
93 | }; | ||
94 | |||
93 | int sh_device_register(struct sh_dev *dev) | 95 | int sh_device_register(struct sh_dev *dev) |
94 | { | 96 | { |
95 | if (!dev) | 97 | if (!dev) |
@@ -107,6 +109,8 @@ int sh_device_register(struct sh_dev *dev) | |||
107 | /* This is needed for USB OHCI to work */ | 109 | /* This is needed for USB OHCI to work */ |
108 | if (dev->dma_mask) | 110 | if (dev->dma_mask) |
109 | dev->dev.dma_mask = dev->dma_mask; | 111 | dev->dev.dma_mask = dev->dma_mask; |
112 | if (dev->coherent_dma_mask) | ||
113 | dev->dev.coherent_dma_mask = dev->coherent_dma_mask; | ||
110 | 114 | ||
111 | snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%s%u", | 115 | snprintf(dev->dev.bus_id, BUS_ID_SIZE, "%s%u", |
112 | dev->name, dev->dev_id); | 116 | dev->name, dev->dev_id); |
@@ -133,8 +137,6 @@ int sh_driver_register(struct sh_driver *drv) | |||
133 | return -EINVAL; | 137 | return -EINVAL; |
134 | } | 138 | } |
135 | 139 | ||
136 | drv->drv.probe = sh_device_probe; | ||
137 | drv->drv.remove = sh_device_remove; | ||
138 | drv->drv.bus = &sh_bus_types[drv->bus_id]; | 140 | drv->drv.bus = &sh_bus_types[drv->bus_id]; |
139 | 141 | ||
140 | return driver_register(&drv->drv); | 142 | return driver_register(&drv->drv); |