diff options
author | Jim Cromie <jim.cromie@gmail.com> | 2006-06-27 05:54:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-27 20:32:42 -0400 |
commit | 9b170b8fdbd14a197ad26b4354f3810c65a96602 (patch) | |
tree | 087cea45b78d6091410729ecd94083833231ea72 | |
parent | 9550a339e1ab1709dd53d92a1b76eecae2df9f3c (diff) |
[PATCH] chardev: GPIO for SCx200 & PC-8736x: refactor scx200_probe to better segregate _gpio initialization
Pull shadow-reg initialization into separate function now, rather than doing
it 2x later (scx200, pc8736x). When we revisit 2nd drvr below, it will be to
reimplement an init function, rather than another refactor.
Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/scx200.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c index 009e6aa16f73..27be55349c65 100644 --- a/arch/i386/kernel/scx200.c +++ b/arch/i386/kernel/scx200.c | |||
@@ -47,9 +47,17 @@ static struct pci_driver scx200_pci_driver = { | |||
47 | 47 | ||
48 | static DEFINE_SPINLOCK(scx200_gpio_config_lock); | 48 | static DEFINE_SPINLOCK(scx200_gpio_config_lock); |
49 | 49 | ||
50 | static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 50 | static void __devinit scx200_init_shadow(void) |
51 | { | 51 | { |
52 | int bank; | 52 | int bank; |
53 | |||
54 | /* read the current values driven on the GPIO signals */ | ||
55 | for (bank = 0; bank < 2; ++bank) | ||
56 | scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank); | ||
57 | } | ||
58 | |||
59 | static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | ||
60 | { | ||
53 | unsigned base; | 61 | unsigned base; |
54 | 62 | ||
55 | if (pdev->device == PCI_DEVICE_ID_NS_SCx200_BRIDGE || | 63 | if (pdev->device == PCI_DEVICE_ID_NS_SCx200_BRIDGE || |
@@ -63,10 +71,7 @@ static int __devinit scx200_probe(struct pci_dev *pdev, const struct pci_device_ | |||
63 | } | 71 | } |
64 | 72 | ||
65 | scx200_gpio_base = base; | 73 | scx200_gpio_base = base; |
66 | 74 | scx200_init_shadow(); | |
67 | /* read the current values driven on the GPIO signals */ | ||
68 | for (bank = 0; bank < 2; ++bank) | ||
69 | scx200_gpio_shadow[bank] = inl(scx200_gpio_base + 0x10 * bank); | ||
70 | 75 | ||
71 | } else { | 76 | } else { |
72 | /* find the base of the Configuration Block */ | 77 | /* find the base of the Configuration Block */ |