Commit ef414434 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] !PCI warnings: Moxa serial

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4eba5e52
...@@ -104,6 +104,7 @@ static char *moxa_brdname[] = ...@@ -104,6 +104,7 @@ static char *moxa_brdname[] =
"CP-204J series", "CP-204J series",
}; };
#ifdef CONFIG_PCI
static struct pci_device_id moxa_pcibrds[] = { static struct pci_device_id moxa_pcibrds[] = {
{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C218, PCI_ANY_ID, PCI_ANY_ID, { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C218, PCI_ANY_ID, PCI_ANY_ID,
0, 0, MOXA_BOARD_C218_PCI }, 0, 0, MOXA_BOARD_C218_PCI },
...@@ -114,6 +115,7 @@ static struct pci_device_id moxa_pcibrds[] = { ...@@ -114,6 +115,7 @@ static struct pci_device_id moxa_pcibrds[] = {
{ 0 } { 0 }
}; };
MODULE_DEVICE_TABLE(pci, moxa_pcibrds); MODULE_DEVICE_TABLE(pci, moxa_pcibrds);
#endif /* CONFIG_PCI */
typedef struct _moxa_isa_board_conf { typedef struct _moxa_isa_board_conf {
int boardType; int boardType;
...@@ -190,9 +192,11 @@ static struct mxser_mstatus GMStatus[MAX_PORTS]; ...@@ -190,9 +192,11 @@ static struct mxser_mstatus GMStatus[MAX_PORTS];
static int verbose = 0; static int verbose = 0;
static int ttymajor = MOXAMAJOR; static int ttymajor = MOXAMAJOR;
/* Variables for insmod */ /* Variables for insmod */
#ifdef MODULE
static int baseaddr[] = {0, 0, 0, 0}; static int baseaddr[] = {0, 0, 0, 0};
static int type[] = {0, 0, 0, 0}; static int type[] = {0, 0, 0, 0};
static int numports[] = {0, 0, 0, 0}; static int numports[] = {0, 0, 0, 0};
#endif
MODULE_AUTHOR("William Chen"); MODULE_AUTHOR("William Chen");
MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver"); MODULE_DESCRIPTION("MOXA Intellio Family Multiport Board Device Driver");
...@@ -215,7 +219,6 @@ static struct semaphore moxaBuffSem; ...@@ -215,7 +219,6 @@ static struct semaphore moxaBuffSem;
/* /*
* static functions: * static functions:
*/ */
static int moxa_get_PCI_conf(struct pci_dev *, int, moxa_board_conf *);
static void do_moxa_softint(void *); static void do_moxa_softint(void *);
static int moxa_open(struct tty_struct *, struct file *); static int moxa_open(struct tty_struct *, struct file *);
static void moxa_close(struct tty_struct *, struct file *); static void moxa_close(struct tty_struct *, struct file *);
...@@ -296,6 +299,32 @@ static struct tty_operations moxa_ops = { ...@@ -296,6 +299,32 @@ static struct tty_operations moxa_ops = {
.tiocmset = moxa_tiocmset, .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) static int __init moxa_init(void)
{ {
int i, numBoards; int i, numBoards;
...@@ -469,30 +498,6 @@ static void __exit moxa_exit(void) ...@@ -469,30 +498,6 @@ static void __exit moxa_exit(void)
module_init(moxa_init); module_init(moxa_init);
module_exit(moxa_exit); 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_) static void do_moxa_softint(void *private_)
{ {
struct moxa_str *ch = (struct moxa_str *) private_; struct moxa_str *ch = (struct moxa_str *) private_;
......
...@@ -198,6 +198,7 @@ static int mxser_numports[] = ...@@ -198,6 +198,7 @@ static int mxser_numports[] =
#define MOXA_GET_CUMAJOR (MOXA + 64) #define MOXA_GET_CUMAJOR (MOXA + 64)
#define MOXA_GETMSTATUS (MOXA + 65) #define MOXA_GETMSTATUS (MOXA + 65)
#ifdef CONFIG_PCI
static struct pci_device_id mxser_pcibrds[] = { static struct pci_device_id mxser_pcibrds[] = {
{ PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C168, PCI_ANY_ID, PCI_ANY_ID, 0, 0, { PCI_VENDOR_ID_MOXA, PCI_DEVICE_ID_C168, PCI_ANY_ID, PCI_ANY_ID, 0, 0,
MXSER_BOARD_C168_PCI }, MXSER_BOARD_C168_PCI },
...@@ -214,6 +215,7 @@ static struct pci_device_id mxser_pcibrds[] = { ...@@ -214,6 +215,7 @@ static struct pci_device_id mxser_pcibrds[] = {
{ 0 } { 0 }
}; };
MODULE_DEVICE_TABLE(pci, mxser_pcibrds); MODULE_DEVICE_TABLE(pci, mxser_pcibrds);
#endif /* CONFIG_PCI */
static int ioaddr[MXSER_BOARDS]; static int ioaddr[MXSER_BOARDS];
static int ttymajor = MXSERMAJOR; static int ttymajor = MXSERMAJOR;
...@@ -330,7 +332,6 @@ struct mxser_hwconf mxsercfg[MXSER_BOARDS]; ...@@ -330,7 +332,6 @@ struct mxser_hwconf mxsercfg[MXSER_BOARDS];
static void mxser_getcfg(int board, struct mxser_hwconf *hwconf); static void mxser_getcfg(int board, struct mxser_hwconf *hwconf);
static int mxser_get_ISA_conf(int, struct mxser_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 void mxser_do_softint(void *);
static int mxser_open(struct tty_struct *, struct file *); static int mxser_open(struct tty_struct *, struct file *);
static void mxser_close(struct tty_struct *, struct file *); static void mxser_close(struct tty_struct *, struct file *);
...@@ -461,6 +462,7 @@ static void mxser_getcfg(int board, struct mxser_hwconf *hwconf) ...@@ -461,6 +462,7 @@ static void mxser_getcfg(int board, struct mxser_hwconf *hwconf)
mxsercfg[board] = *hwconf; mxsercfg[board] = *hwconf;
} }
#ifdef CONFIG_PCI
static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser_hwconf *hwconf) static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser_hwconf *hwconf)
{ {
int i; int i;
...@@ -485,6 +487,7 @@ static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser ...@@ -485,6 +487,7 @@ static int mxser_get_PCI_conf(struct pci_dev *pdev, int board_type, struct mxser
} }
return (0); return (0);
} }
#endif /* CONFIG_PCI */
static struct tty_operations mxser_ops = { static struct tty_operations mxser_ops = {
.open = mxser_open, .open = mxser_open,
......
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