Skip to content

Commit

Permalink
[PATCH] rocketport: make it work when statically linked into kernel
Browse files Browse the repository at this point in the history
The driver had incorrectly wrapped module_init(rp_init) in #ifdef MODULE,
so it worked only when compiled as a module.

Tested by Wolfgang Denk with this device:

    00:0e.0 Communication controller: Comtrol Corporation RocketPort 8 port w/RJ11 connectors (rev 04)
        Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
        Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR-
        Interrupt: pin A routed to IRQ 11
        Region 0: I/O ports at 7000 [size=64]

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Bjorn Helgaas authored and Linus Torvalds committed Oct 31, 2005
1 parent 708f430 commit d269cdd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ static int sInitController(CONTROLLER_T * CtlP, int CtlNum, ByteIO_t MudbacIO,
static int sReadAiopID(ByteIO_t io);
static int sReadAiopNumChan(WordIO_t io);

#ifdef MODULE
MODULE_AUTHOR("Theodore Ts'o");
MODULE_DESCRIPTION("Comtrol RocketPort driver");
module_param(board1, ulong, 0);
Expand Down Expand Up @@ -288,17 +287,14 @@ MODULE_PARM_DESC(pc104_3, "set interface types for ISA(PC104) board #3 (e.g. pc1
module_param_array(pc104_4, ulong, NULL, 0);
MODULE_PARM_DESC(pc104_4, "set interface types for ISA(PC104) board #4 (e.g. pc104_4=232,232,485,485,...");

int rp_init(void);
static int rp_init(void);
static void rp_cleanup_module(void);

module_init(rp_init);
module_exit(rp_cleanup_module);

#endif

#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual BSD/GPL");
#endif

/*************************************************************************/
/* Module code starts here */
Expand Down Expand Up @@ -2378,7 +2374,7 @@ static struct tty_operations rocket_ops = {
/*
* The module "startup" routine; it's run when the module is loaded.
*/
int __init rp_init(void)
static int __init rp_init(void)
{
int retval, pci_boards_found, isa_boards_found, i;

Expand Down Expand Up @@ -2502,7 +2498,6 @@ int __init rp_init(void)
return 0;
}

#ifdef MODULE

static void rp_cleanup_module(void)
{
Expand Down Expand Up @@ -2530,7 +2525,6 @@ static void rp_cleanup_module(void)
if (controller)
release_region(controller, 4);
}
#endif

/***************************************************************************
Function: sInitController
Expand Down

0 comments on commit d269cdd

Please sign in to comment.