Commit c17df7f9 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] parport: use module_init()

	Init of low-level drivers (except parport_pc) turned into module_init().
parent 8b78f3bd
...@@ -28,10 +28,6 @@ static int irq[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_IRQ_P ...@@ -28,10 +28,6 @@ static int irq[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_IRQ_P
static int dma[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_DMA_NONE }; static int dma[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_DMA_NONE };
extern int parport_pc_init(int *io, int *io_hi, int *irq, int *dma); extern int parport_pc_init(int *io, int *io_hi, int *irq, int *dma);
extern int parport_sunbpp_init(void);
extern int parport_amiga_init(void);
extern int parport_mfc3_init(void);
extern int parport_atari_init(void);
static int parport_setup_ptr __initdata = 0; static int parport_setup_ptr __initdata = 0;
...@@ -148,21 +144,6 @@ int __init parport_init (void) ...@@ -148,21 +144,6 @@ int __init parport_init (void)
#ifdef CONFIG_PARPORT_PC #ifdef CONFIG_PARPORT_PC
parport_pc_init(io, io_hi, irq, dma); parport_pc_init(io, io_hi, irq, dma);
#endif
#ifdef CONFIG_PARPORT_AMIGA
parport_amiga_init();
#endif
#ifdef CONFIG_PARPORT_MFC3
parport_mfc3_init();
#endif
#ifdef CONFIG_PARPORT_ATARI
parport_atari_init();
#endif
#ifdef CONFIG_PARPORT_ARC
parport_arc_init();
#endif
#ifdef CONFIG_PARPORT_SUNBPP
parport_sunbpp_init();
#endif #endif
return 0; return 0;
} }
......
...@@ -234,7 +234,7 @@ static struct parport_operations pp_amiga_ops = { ...@@ -234,7 +234,7 @@ static struct parport_operations pp_amiga_ops = {
/* ----------- Initialisation code --------------------------------- */ /* ----------- Initialisation code --------------------------------- */
int __init parport_amiga_init(void) static int __init parport_amiga_init(void)
{ {
struct parport *p; struct parport *p;
int err; int err;
...@@ -276,7 +276,7 @@ int __init parport_amiga_init(void) ...@@ -276,7 +276,7 @@ int __init parport_amiga_init(void)
return err; return err;
} }
void __exit parport_amiga_exit(void) static void __exit parport_amiga_exit(void)
{ {
if (this_port->irq != PARPORT_IRQ_NONE) if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_AMIGA_CIAA_FLG, this_port); free_irq(IRQ_AMIGA_CIAA_FLG, this_port);
......
...@@ -104,7 +104,7 @@ static struct parport_operations parport_arc_ops = ...@@ -104,7 +104,7 @@ static struct parport_operations parport_arc_ops =
/* --- Initialisation code -------------------------------- */ /* --- Initialisation code -------------------------------- */
int parport_arc_init(void) static int parport_arc_init(void)
{ {
/* Archimedes hardware provides only one port, at a fixed address */ /* Archimedes hardware provides only one port, at a fixed address */
struct parport *p; struct parport *p;
...@@ -136,3 +136,5 @@ int parport_arc_init(void) ...@@ -136,3 +136,5 @@ int parport_arc_init(void)
return 1; return 1;
} }
module_init(parport_arc_init)
...@@ -185,8 +185,7 @@ static struct parport_operations parport_atari_ops = { ...@@ -185,8 +185,7 @@ static struct parport_operations parport_atari_ops = {
}; };
int __init static int __init parport_atari_init(void)
parport_atari_init(void)
{ {
struct parport *p; struct parport *p;
unsigned long flags; unsigned long flags;
...@@ -208,11 +207,11 @@ parport_atari_init(void) ...@@ -208,11 +207,11 @@ parport_atari_init(void)
IRQ_MFP_BUSY, PARPORT_DMA_NONE, IRQ_MFP_BUSY, PARPORT_DMA_NONE,
&parport_atari_ops); &parport_atari_ops);
if (!p) if (!p)
return 0; return -ENODEV;
if (request_irq(IRQ_MFP_BUSY, parport_atari_interrupt, if (request_irq(IRQ_MFP_BUSY, parport_atari_interrupt,
IRQ_TYPE_SLOW, p->name, p)) { IRQ_TYPE_SLOW, p->name, p)) {
parport_unregister_port (p); parport_unregister_port (p);
return 0; return -ENODEV;
} }
this_port = p; this_port = p;
...@@ -221,30 +220,23 @@ parport_atari_init(void) ...@@ -221,30 +220,23 @@ parport_atari_init(void)
parport_announce_port (p); parport_announce_port (p);
return 1; return 0;
} }
return 0; return -ENODEV;
} }
#ifdef MODULE static void __exit parport_atari_exit(void)
MODULE_AUTHOR("Andreas Schwab");
MODULE_DESCRIPTION("Parport Driver for Atari builtin Port");
MODULE_SUPPORTED_DEVICE("Atari builtin Parallel Port");
MODULE_LICENSE("GPL");
int
init_module(void)
{
return parport_atari_init() ? 0 : -ENODEV;
}
void
cleanup_module(void)
{ {
if (this_port->irq != PARPORT_IRQ_NONE) if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_MFP_BUSY, this_port); free_irq(IRQ_MFP_BUSY, this_port);
parport_proc_unregister(this_port); parport_proc_unregister(this_port);
parport_unregister_port(this_port); parport_unregister_port(this_port);
} }
#endif
MODULE_AUTHOR("Andreas Schwab");
MODULE_DESCRIPTION("Parport Driver for Atari builtin Port");
MODULE_SUPPORTED_DEVICE("Atari builtin Parallel Port");
MODULE_LICENSE("GPL");
module_init(parport_atari_init)
module_exit(parport_atari_exit)
...@@ -320,7 +320,7 @@ static struct parport_operations pp_mfc3_ops = { ...@@ -320,7 +320,7 @@ static struct parport_operations pp_mfc3_ops = {
/* ----------- Initialisation code --------------------------------- */ /* ----------- Initialisation code --------------------------------- */
int __init parport_mfc3_init(void) static int __init parport_mfc3_init(void)
{ {
struct parport *p; struct parport *p;
int pias = 0; int pias = 0;
...@@ -378,7 +378,7 @@ int __init parport_mfc3_init(void) ...@@ -378,7 +378,7 @@ int __init parport_mfc3_init(void)
return pias ? 0 : -ENODEV; return pias ? 0 : -ENODEV;
} }
void __exit parport_mfc3_exit(void) static void __exit parport_mfc3_exit(void)
{ {
int i; int i;
...@@ -403,4 +403,3 @@ MODULE_LICENSE("GPL"); ...@@ -403,4 +403,3 @@ MODULE_LICENSE("GPL");
module_init(parport_mfc3_init) module_init(parport_mfc3_init)
module_exit(parport_mfc3_exit) module_exit(parport_mfc3_exit)
...@@ -349,11 +349,7 @@ static int __init init_one_port(struct sbus_dev *sdev) ...@@ -349,11 +349,7 @@ static int __init init_one_port(struct sbus_dev *sdev)
return 1; return 1;
} }
#ifdef MODULE static int __init parport_sunbpp_init(void)
int init_module(void)
#else
int __init parport_sunbpp_init(void)
#endif
{ {
struct sbus_bus *sbus; struct sbus_bus *sbus;
struct sbus_dev *sdev; struct sbus_dev *sdev;
...@@ -368,13 +364,7 @@ int __init parport_sunbpp_init(void) ...@@ -368,13 +364,7 @@ int __init parport_sunbpp_init(void)
return count ? 0 : -ENODEV; return count ? 0 : -ENODEV;
} }
#ifdef MODULE static void __exit parport_sunbpp_exit(void)
MODULE_AUTHOR("Derrick J Brashear");
MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");
MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port");
void
cleanup_module(void)
{ {
struct parport *p = parport_enumerate(); struct parport *p = parport_enumerate();
...@@ -396,6 +386,11 @@ cleanup_module(void) ...@@ -396,6 +386,11 @@ cleanup_module(void)
p = next; p = next;
} }
} }
#endif
MODULE_AUTHOR("Derrick J Brashear");
MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");
MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(parport_sunbpp_init)
module_exit(parport_sunbpp_exit)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment