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
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_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;
......@@ -148,21 +144,6 @@ int __init parport_init (void)
#ifdef CONFIG_PARPORT_PC
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
return 0;
}
......
......@@ -234,7 +234,7 @@ static struct parport_operations pp_amiga_ops = {
/* ----------- Initialisation code --------------------------------- */
int __init parport_amiga_init(void)
static int __init parport_amiga_init(void)
{
struct parport *p;
int err;
......@@ -276,7 +276,7 @@ int __init parport_amiga_init(void)
return err;
}
void __exit parport_amiga_exit(void)
static void __exit parport_amiga_exit(void)
{
if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_AMIGA_CIAA_FLG, this_port);
......
......@@ -104,7 +104,7 @@ static struct parport_operations parport_arc_ops =
/* --- Initialisation code -------------------------------- */
int parport_arc_init(void)
static int parport_arc_init(void)
{
/* Archimedes hardware provides only one port, at a fixed address */
struct parport *p;
......@@ -136,3 +136,5 @@ int parport_arc_init(void)
return 1;
}
module_init(parport_arc_init)
......@@ -185,8 +185,7 @@ static struct parport_operations parport_atari_ops = {
};
int __init
parport_atari_init(void)
static int __init parport_atari_init(void)
{
struct parport *p;
unsigned long flags;
......@@ -208,11 +207,11 @@ parport_atari_init(void)
IRQ_MFP_BUSY, PARPORT_DMA_NONE,
&parport_atari_ops);
if (!p)
return 0;
return -ENODEV;
if (request_irq(IRQ_MFP_BUSY, parport_atari_interrupt,
IRQ_TYPE_SLOW, p->name, p)) {
parport_unregister_port (p);
return 0;
return -ENODEV;
}
this_port = p;
......@@ -221,30 +220,23 @@ parport_atari_init(void)
parport_announce_port (p);
return 1;
return 0;
}
return 0;
return -ENODEV;
}
#ifdef MODULE
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)
static void __exit parport_atari_exit(void)
{
if (this_port->irq != PARPORT_IRQ_NONE)
free_irq(IRQ_MFP_BUSY, this_port);
parport_proc_unregister(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 = {
/* ----------- Initialisation code --------------------------------- */
int __init parport_mfc3_init(void)
static int __init parport_mfc3_init(void)
{
struct parport *p;
int pias = 0;
......@@ -378,7 +378,7 @@ int __init parport_mfc3_init(void)
return pias ? 0 : -ENODEV;
}
void __exit parport_mfc3_exit(void)
static void __exit parport_mfc3_exit(void)
{
int i;
......@@ -403,4 +403,3 @@ MODULE_LICENSE("GPL");
module_init(parport_mfc3_init)
module_exit(parport_mfc3_exit)
......@@ -349,11 +349,7 @@ static int __init init_one_port(struct sbus_dev *sdev)
return 1;
}
#ifdef MODULE
int init_module(void)
#else
int __init parport_sunbpp_init(void)
#endif
static int __init parport_sunbpp_init(void)
{
struct sbus_bus *sbus;
struct sbus_dev *sdev;
......@@ -368,13 +364,7 @@ int __init parport_sunbpp_init(void)
return count ? 0 : -ENODEV;
}
#ifdef MODULE
MODULE_AUTHOR("Derrick J Brashear");
MODULE_DESCRIPTION("Parport Driver for Sparc bidirectional Port");
MODULE_SUPPORTED_DEVICE("Sparc Bidirectional Parallel Port");
void
cleanup_module(void)
static void __exit parport_sunbpp_exit(void)
{
struct parport *p = parport_enumerate();
......@@ -396,6 +386,11 @@ cleanup_module(void)
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_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