From: Geert Uytterhoeven Kill warnings in MOXA Intellio and Smartio multiport serial drivers when !PCI. Also kill warnings about unused variables in the non-modular case. Signed-off-by: Geert Uytterhoeven Signed-off-by: Andrew Morton --- 25-akpm/drivers/char/moxa.c | 55 +++++++++++++++++++++++-------------------- 25-akpm/drivers/char/mxser.c | 5 +++ 2 files changed, 34 insertions(+), 26 deletions(-) diff -puN drivers/char/moxa.c~pci-warnings-moxa-serial drivers/char/moxa.c --- 25/drivers/char/moxa.c~pci-warnings-moxa-serial 2004-07-26 17:27:04.455056288 -0700 +++ 25-akpm/drivers/char/moxa.c 2004-07-26 17:27:04.463055072 -0700 @@ -104,6 +104,7 @@ static char *moxa_brdname[] = "CP-204J series", }; +#ifdef CONFIG_PCI static struct pci_device_id moxa_pcibrds[] = { { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C218, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MOXA_BOARD_C218_PCI }, @@ -114,6 +115,7 @@ static struct pci_device_id moxa_pcibrds { 0 } }; MODULE_DEVICE_TABLE(pci, moxa_pcibrds); +#endif /* CONFIG_PCI */ typedef struct _moxa_isa_board_conf { int boardType; @@ -190,9 +192,11 @@ static struct mxser_mstatus GMStatus[MAX static int verbose = 0; static int ttymajor = MOXAMAJOR; /* Variables for insmod */ +#ifdef MODULE static int baseaddr[] = {0, 0, 0, 0}; static int type[] = {0, 0, 0, 0}; static int numports[] = {0, 0, 0, 0}; +#endif MODULE_AUTHOR("William Chen"); MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver"); @@ -215,7 +219,6 @@ static struct semaphore moxaBuffSem; /* * static functions: */ -static int moxa_get_PCI_conf(struct pci_dev *, int, moxa_board_conf *); static void do_moxa_softint(void *); static int moxa_open(struct tty_struct *, struct file *); static void moxa_close(struct tty_struct *, struct file *); @@ -296,6 +299,32 @@ static struct tty_operations moxa_ops = .tiocmset = moxa_tiocmset, }; +#ifdef CONFIG_PCI +static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board) +{ + board->baseAddr = pci_resource_start (p, 2); + board->boardType = board_type; + switch (board_type) { + case MOXA_BOARD_C218_ISA: + case MOXA_BOARD_C218_PCI: + board->numPorts = 8; + break; + + case MOXA_BOARD_CP204J: + board->numPorts = 4; + break; + default: + board->numPorts = 0; + break; + } + board->busType = MOXA_BUS_TYPE_PCI; + board->pciInfo.busNum = p->bus->number; + board->pciInfo.devNum = p->devfn >> 3; + + return (0); +} +#endif /* CONFIG_PCI */ + static int __init moxa_init(void) { int i, numBoards; @@ -469,30 +498,6 @@ static void __exit moxa_exit(void) module_init(moxa_init); module_exit(moxa_exit); -static int moxa_get_PCI_conf(struct pci_dev *p, int board_type, moxa_board_conf * board) -{ - board->baseAddr = pci_resource_start (p, 2); - board->boardType = board_type; - switch (board_type) { - case MOXA_BOARD_C218_ISA: - case MOXA_BOARD_C218_PCI: - board->numPorts = 8; - break; - - case MOXA_BOARD_CP204J: - board->numPorts = 4; - break; - default: - board->numPorts = 0; - break; - } - board->busType = MOXA_BUS_TYPE_PCI; - board->pciInfo.busNum = p->bus->number; - board->pciInfo.devNum = p->devfn >> 3; - - return (0); -} - static void do_moxa_softint(void *private_) { struct moxa_str *ch = (struct moxa_str *) private_; diff -puN drivers/char/mxser.c~pci-warnings-moxa-serial drivers/char/mxser.c --- 25/drivers/char/mxser.c~pci-warnings-moxa-serial 2004-07-26 17:27:04.457055984 -0700 +++ 25-akpm/drivers/char/mxser.c 2004-07-26 17:27:04.465054768 -0700 @@ -198,6 +198,7 @@ static int mxser_numports[] = #define MOXA_GET_CUMAJOR (MOXA + 64) #define MOXA_GETMSTATUS (MOXA + 65) +#ifdef CONFIG_PCI static struct pci_device_id mxser_pcibrds[] = { { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C168, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MXSER_BOARD_C168_PCI }, @@ -214,6 +215,7 @@ static struct pci_device_id mxser_pcibrd { 0 } }; MODULE_DEVICE_TABLE(pci, mxser_pcibrds); +#endif /* CONFIG_PCI */ static int ioaddr[MXSER_BOARDS]; static int ttymajor = MXSERMAJOR; @@ -330,7 +332,6 @@ struct mxser_hwconf mxsercfg[MXSER_BOARD static void mxser_getcfg(int board, struct mxser_hwconf *hwconf); static int mxser_get_ISA_conf(int, struct mxser_hwconf *); -static int mxser_get_PCI_conf(struct pci_dev *, int, struct mxser_hwconf *); static void mxser_do_softint(void *); static int mxser_open(struct tty_struct *, struct file *); static void mxser_close(struct tty_struct *, struct file *); @@ -461,6 +462,7 @@ static void mxser_getcfg(int board, stru mxsercfg[board] = *hwconf; } +#ifdef CONFIG_PCI static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser_hwconf *hwconf) { int i; @@ -485,6 +487,7 @@ static int mxser_get_PCI_conf(struct pci } return (0); } +#endif /* CONFIG_PCI */ static struct tty_operations mxser_ops = { .open = mxser_open, _