aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-sa1100
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-11-09 17:32:44 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-11-09 17:32:44 -0500
commit3ae5eaec1d2d9c0cf53745352e7d4b152810ba24 (patch)
treed8825be54cefb6ad6707478d719c8e30605bee7b /arch/arm/mach-sa1100
parent00d3dcdd96646be6059cc21f2efa94c4edc1eda5 (diff)
[DRIVER MODEL] Convert platform drivers to use struct platform_driver
This allows us to eliminate the casts in the drivers, and eventually remove the use of the device_driver function pointer methods for platform device drivers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/mach-sa1100')
-rw-r--r--arch/arm/mach-sa1100/neponset.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index 69f1970646c6..9e02bc3712a0 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -137,7 +137,7 @@ static struct sa1100_port_fns neponset_port_fns __initdata = {
137 .get_mctrl = neponset_get_mctrl, 137 .get_mctrl = neponset_get_mctrl,
138}; 138};
139 139
140static int neponset_probe(struct device *dev) 140static int neponset_probe(struct platform_device *dev)
141{ 141{
142 sa1100_register_uart_fns(&neponset_port_fns); 142 sa1100_register_uart_fns(&neponset_port_fns);
143 143
@@ -178,27 +178,27 @@ static int neponset_probe(struct device *dev)
178/* 178/*
179 * LDM power management. 179 * LDM power management.
180 */ 180 */
181static int neponset_suspend(struct device *dev, pm_message_t state) 181static int neponset_suspend(struct platform_device *dev, pm_message_t state)
182{ 182{
183 /* 183 /*
184 * Save state. 184 * Save state.
185 */ 185 */
186 if (!dev->power.saved_state) 186 if (!dev->dev.power.saved_state)
187 dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL); 187 dev->dev.power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
188 if (!dev->power.saved_state) 188 if (!dev->dev.power.saved_state)
189 return -ENOMEM; 189 return -ENOMEM;
190 190
191 *(unsigned int *)dev->power.saved_state = NCR_0; 191 *(unsigned int *)dev->dev.power.saved_state = NCR_0;
192 192
193 return 0; 193 return 0;
194} 194}
195 195
196static int neponset_resume(struct device *dev) 196static int neponset_resume(struct platform_device *dev)
197{ 197{
198 if (dev->power.saved_state) { 198 if (dev->dev.power.saved_state) {
199 NCR_0 = *(unsigned int *)dev->power.saved_state; 199 NCR_0 = *(unsigned int *)dev->dev.power.saved_state;
200 kfree(dev->power.saved_state); 200 kfree(dev->dev.power.saved_state);
201 dev->power.saved_state = NULL; 201 dev->dev.power.saved_state = NULL;
202 } 202 }
203 203
204 return 0; 204 return 0;
@@ -209,12 +209,13 @@ static int neponset_resume(struct device *dev)
209#define neponset_resume NULL 209#define neponset_resume NULL
210#endif 210#endif
211 211
212static struct device_driver neponset_device_driver = { 212static struct platform_driver neponset_device_driver = {
213 .name = "neponset",
214 .bus = &platform_bus_type,
215 .probe = neponset_probe, 213 .probe = neponset_probe,
216 .suspend = neponset_suspend, 214 .suspend = neponset_suspend,
217 .resume = neponset_resume, 215 .resume = neponset_resume,
216 .driver = {
217 .name = "neponset",
218 },
218}; 219};
219 220
220static struct resource neponset_resources[] = { 221static struct resource neponset_resources[] = {
@@ -293,7 +294,7 @@ static struct platform_device *devices[] __initdata = {
293 294
294static int __init neponset_init(void) 295static int __init neponset_init(void)
295{ 296{
296 driver_register(&neponset_device_driver); 297 platform_driver_register(&neponset_device_driver);
297 298
298 /* 299 /*
299 * The Neponset is only present on the Assabet machine type. 300 * The Neponset is only present on the Assabet machine type.