diff options
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_amiga.c | 15 | ||||
-rw-r--r-- | drivers/parport/parport_cs.c | 14 | ||||
-rw-r--r-- | drivers/parport/parport_gsc.c | 4 | ||||
-rw-r--r-- | drivers/parport/parport_sunbpp.c | 5 | ||||
-rw-r--r-- | drivers/parport/procfs.c | 6 |
5 files changed, 8 insertions, 36 deletions
diff --git a/drivers/parport/parport_amiga.c b/drivers/parport/parport_amiga.c index ee78e0ee6e05..09503b8d12e6 100644 --- a/drivers/parport/parport_amiga.c +++ b/drivers/parport/parport_amiga.c | |||
@@ -244,20 +244,7 @@ static struct platform_driver amiga_parallel_driver = { | |||
244 | }, | 244 | }, |
245 | }; | 245 | }; |
246 | 246 | ||
247 | static int __init amiga_parallel_init(void) | 247 | module_platform_driver_probe(amiga_parallel_driver, amiga_parallel_probe); |
248 | { | ||
249 | return platform_driver_probe(&amiga_parallel_driver, | ||
250 | amiga_parallel_probe); | ||
251 | } | ||
252 | |||
253 | module_init(amiga_parallel_init); | ||
254 | |||
255 | static void __exit amiga_parallel_exit(void) | ||
256 | { | ||
257 | platform_driver_unregister(&amiga_parallel_driver); | ||
258 | } | ||
259 | |||
260 | module_exit(amiga_parallel_exit); | ||
261 | 248 | ||
262 | MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>"); | 249 | MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>"); |
263 | MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port"); | 250 | MODULE_DESCRIPTION("Parport Driver for Amiga builtin Port"); |
diff --git a/drivers/parport/parport_cs.c b/drivers/parport/parport_cs.c index 067ad517c1f5..e9b52e4a4648 100644 --- a/drivers/parport/parport_cs.c +++ b/drivers/parport/parport_cs.c | |||
@@ -193,16 +193,4 @@ static struct pcmcia_driver parport_cs_driver = { | |||
193 | .remove = parport_detach, | 193 | .remove = parport_detach, |
194 | .id_table = parport_ids, | 194 | .id_table = parport_ids, |
195 | }; | 195 | }; |
196 | 196 | module_pcmcia_driver(parport_cs_driver); | |
197 | static int __init init_parport_cs(void) | ||
198 | { | ||
199 | return pcmcia_register_driver(&parport_cs_driver); | ||
200 | } | ||
201 | |||
202 | static void __exit exit_parport_cs(void) | ||
203 | { | ||
204 | pcmcia_unregister_driver(&parport_cs_driver); | ||
205 | } | ||
206 | |||
207 | module_init(init_parport_cs); | ||
208 | module_exit(exit_parport_cs); | ||
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index 050773c36823..a5251cb5fb0c 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c | |||
@@ -246,14 +246,14 @@ struct parport *parport_gsc_probe_port(unsigned long base, | |||
246 | printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); | 246 | printk (KERN_DEBUG "parport (0x%lx): no memory!\n", base); |
247 | return NULL; | 247 | return NULL; |
248 | } | 248 | } |
249 | ops = kmalloc (sizeof (struct parport_operations), GFP_KERNEL); | 249 | ops = kmemdup(&parport_gsc_ops, sizeof(struct parport_operations), |
250 | GFP_KERNEL); | ||
250 | if (!ops) { | 251 | if (!ops) { |
251 | printk (KERN_DEBUG "parport (0x%lx): no memory for ops!\n", | 252 | printk (KERN_DEBUG "parport (0x%lx): no memory for ops!\n", |
252 | base); | 253 | base); |
253 | kfree (priv); | 254 | kfree (priv); |
254 | return NULL; | 255 | return NULL; |
255 | } | 256 | } |
256 | memcpy (ops, &parport_gsc_ops, sizeof (struct parport_operations)); | ||
257 | priv->ctr = 0xc; | 257 | priv->ctr = 0xc; |
258 | priv->ctr_writable = 0xff; | 258 | priv->ctr_writable = 0xff; |
259 | priv->dma_buf = 0; | 259 | priv->dma_buf = 0; |
diff --git a/drivers/parport/parport_sunbpp.c b/drivers/parport/parport_sunbpp.c index 5c4b6a1db6ca..dffd6d0bd15b 100644 --- a/drivers/parport/parport_sunbpp.c +++ b/drivers/parport/parport_sunbpp.c | |||
@@ -284,12 +284,11 @@ static int bpp_probe(struct platform_device *op) | |||
284 | size = resource_size(&op->resource[0]); | 284 | size = resource_size(&op->resource[0]); |
285 | dma = PARPORT_DMA_NONE; | 285 | dma = PARPORT_DMA_NONE; |
286 | 286 | ||
287 | ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL); | 287 | ops = kmemdup(&parport_sunbpp_ops, sizeof(struct parport_operations), |
288 | GFP_KERNEL); | ||
288 | if (!ops) | 289 | if (!ops) |
289 | goto out_unmap; | 290 | goto out_unmap; |
290 | 291 | ||
291 | memcpy (ops, &parport_sunbpp_ops, sizeof(struct parport_operations)); | ||
292 | |||
293 | dprintk(("register_port\n")); | 292 | dprintk(("register_port\n")); |
294 | if (!(p = parport_register_port((unsigned long)base, irq, dma, ops))) | 293 | if (!(p = parport_register_port((unsigned long)base, irq, dma, ops))) |
295 | goto out_free_ops; | 294 | goto out_free_ops; |
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c index 3f56bc086cb5..92ed045a5f93 100644 --- a/drivers/parport/procfs.c +++ b/drivers/parport/procfs.c | |||
@@ -476,10 +476,9 @@ int parport_proc_register(struct parport *port) | |||
476 | struct parport_sysctl_table *t; | 476 | struct parport_sysctl_table *t; |
477 | int i; | 477 | int i; |
478 | 478 | ||
479 | t = kmalloc(sizeof(*t), GFP_KERNEL); | 479 | t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL); |
480 | if (t == NULL) | 480 | if (t == NULL) |
481 | return -ENOMEM; | 481 | return -ENOMEM; |
482 | memcpy(t, &parport_sysctl_template, sizeof(*t)); | ||
483 | 482 | ||
484 | t->device_dir[0].extra1 = port; | 483 | t->device_dir[0].extra1 = port; |
485 | 484 | ||
@@ -523,10 +522,9 @@ int parport_device_proc_register(struct pardevice *device) | |||
523 | struct parport_device_sysctl_table *t; | 522 | struct parport_device_sysctl_table *t; |
524 | struct parport * port = device->port; | 523 | struct parport * port = device->port; |
525 | 524 | ||
526 | t = kmalloc(sizeof(*t), GFP_KERNEL); | 525 | t = kmemdup(&parport_device_sysctl_template, sizeof(*t), GFP_KERNEL); |
527 | if (t == NULL) | 526 | if (t == NULL) |
528 | return -ENOMEM; | 527 | return -ENOMEM; |
529 | memcpy(t, &parport_device_sysctl_template, sizeof(*t)); | ||
530 | 528 | ||
531 | t->dev_dir[0].child = t->parport_dir; | 529 | t->dev_dir[0].child = t->parport_dir; |
532 | t->parport_dir[0].child = t->port_dir; | 530 | t->parport_dir[0].child = t->port_dir; |