Skip to content

Commit

Permalink
[PATCH] sx: fix non-PCI build
Browse files Browse the repository at this point in the history
When CONFIG_PCI is not defined (i.e.  PCI bus is disabled), the sx driver
fails to link, since some pci functions are not available.  Fix this
behaviour to be able to compile this driver on machines with no PCI bus
(but with ISA bus support).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Dec 13, 2006
1 parent fb0c929 commit 3468a33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ config SPECIALIX_RTSCTS

config SX
tristate "Specialix SX (and SI) card support"
depends on SERIAL_NONSTANDARD
depends on SERIAL_NONSTANDARD && (PCI || EISA || ISA)
help
This is a driver for the SX and SI multiport serial cards.
Please read the file <file:Documentation/sx.txt> for details.
Expand Down
8 changes: 8 additions & 0 deletions drivers/char/sx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,8 +2498,10 @@ static void __devexit sx_remove_card(struct sx_board *board,
/* It is safe/allowed to del_timer a non-active timer */
del_timer(&board->timer);
if (pdev) {
#ifdef CONFIG_PCI
pci_iounmap(pdev, board->base);
pci_release_region(pdev, IS_CF_BOARD(board) ? 3 : 2);
#endif
} else {
iounmap(board->base);
release_region(board->hw_base, board->hw_len);
Expand Down Expand Up @@ -2601,6 +2603,7 @@ static struct eisa_driver sx_eisadriver = {

#endif

#ifdef CONFIG_PCI
/********************************************************
* Setting bit 17 in the CNTRL register of the PLX 9050 *
* chip forces a retry on writes while a read is pending.*
Expand Down Expand Up @@ -2632,10 +2635,12 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board)
}
iounmap(rebase);
}
#endif

static int __devinit sx_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
#ifdef CONFIG_PCI
struct sx_board *board;
unsigned int i, reg;
int retval = -EIO;
Expand Down Expand Up @@ -2700,6 +2705,9 @@ static int __devinit sx_pci_probe(struct pci_dev *pdev,
board->flags &= ~SX_BOARD_PRESENT;
err:
return retval;
#else
return -ENODEV;
#endif
}

static void __devexit sx_pci_remove(struct pci_dev *pdev)
Expand Down

0 comments on commit 3468a33

Please sign in to comment.