diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2006-12-13 03:34:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:49 -0500 |
commit | 3468a33e98524a7661a158251b10cea7c9fafece (patch) | |
tree | 4ba528780a725ef10285ce274c692402afa896f1 /drivers/char/sx.c | |
parent | fb0c9295b81f5c7f51058aabfadd13d8e70b48f4 (diff) |
[PATCH] sx: fix non-PCI build
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>
Diffstat (limited to 'drivers/char/sx.c')
-rw-r--r-- | drivers/char/sx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/char/sx.c b/drivers/char/sx.c index a3008ce13015..1da92a689ae4 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c | |||
@@ -2498,8 +2498,10 @@ static void __devexit sx_remove_card(struct sx_board *board, | |||
2498 | /* It is safe/allowed to del_timer a non-active timer */ | 2498 | /* It is safe/allowed to del_timer a non-active timer */ |
2499 | del_timer(&board->timer); | 2499 | del_timer(&board->timer); |
2500 | if (pdev) { | 2500 | if (pdev) { |
2501 | #ifdef CONFIG_PCI | ||
2501 | pci_iounmap(pdev, board->base); | 2502 | pci_iounmap(pdev, board->base); |
2502 | pci_release_region(pdev, IS_CF_BOARD(board) ? 3 : 2); | 2503 | pci_release_region(pdev, IS_CF_BOARD(board) ? 3 : 2); |
2504 | #endif | ||
2503 | } else { | 2505 | } else { |
2504 | iounmap(board->base); | 2506 | iounmap(board->base); |
2505 | release_region(board->hw_base, board->hw_len); | 2507 | release_region(board->hw_base, board->hw_len); |
@@ -2601,6 +2603,7 @@ static struct eisa_driver sx_eisadriver = { | |||
2601 | 2603 | ||
2602 | #endif | 2604 | #endif |
2603 | 2605 | ||
2606 | #ifdef CONFIG_PCI | ||
2604 | /******************************************************** | 2607 | /******************************************************** |
2605 | * Setting bit 17 in the CNTRL register of the PLX 9050 * | 2608 | * Setting bit 17 in the CNTRL register of the PLX 9050 * |
2606 | * chip forces a retry on writes while a read is pending.* | 2609 | * chip forces a retry on writes while a read is pending.* |
@@ -2632,10 +2635,12 @@ static void __devinit fix_sx_pci(struct pci_dev *pdev, struct sx_board *board) | |||
2632 | } | 2635 | } |
2633 | iounmap(rebase); | 2636 | iounmap(rebase); |
2634 | } | 2637 | } |
2638 | #endif | ||
2635 | 2639 | ||
2636 | static int __devinit sx_pci_probe(struct pci_dev *pdev, | 2640 | static int __devinit sx_pci_probe(struct pci_dev *pdev, |
2637 | const struct pci_device_id *ent) | 2641 | const struct pci_device_id *ent) |
2638 | { | 2642 | { |
2643 | #ifdef CONFIG_PCI | ||
2639 | struct sx_board *board; | 2644 | struct sx_board *board; |
2640 | unsigned int i, reg; | 2645 | unsigned int i, reg; |
2641 | int retval = -EIO; | 2646 | int retval = -EIO; |
@@ -2700,6 +2705,9 @@ err_flag: | |||
2700 | board->flags &= ~SX_BOARD_PRESENT; | 2705 | board->flags &= ~SX_BOARD_PRESENT; |
2701 | err: | 2706 | err: |
2702 | return retval; | 2707 | return retval; |
2708 | #else | ||
2709 | return -ENODEV; | ||
2710 | #endif | ||
2703 | } | 2711 | } |
2704 | 2712 | ||
2705 | static void __devexit sx_pci_remove(struct pci_dev *pdev) | 2713 | static void __devexit sx_pci_remove(struct pci_dev *pdev) |