aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/cyclades.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-05-08 03:36:12 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:23 -0400
commit2b1da41fb3eb41fab1e27cdcce7712b61ef45186 (patch)
treee581e0ad23b47c7908bb548c0393edfdd0175263 /drivers/char/cyclades.c
parent38d090932564140454e5a0bc915beca07d8a65a0 (diff)
Char: cyclades, init Ze immediately
There will be no other choice after introducing pci probing anyway. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/cyclades.c')
-rw-r--r--drivers/char/cyclades.c59
1 files changed, 8 insertions, 51 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index 478c388ed6da..a49232746438 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -4714,12 +4714,14 @@ static void plx_init(void __iomem * addr, __u32 initctl)
4714static int __devinit cy_init_Ze(unsigned long cy_pci_phys0, 4714static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
4715 unsigned long cy_pci_phys2, 4715 unsigned long cy_pci_phys2,
4716 struct RUNTIME_9060 __iomem *cy_pci_addr0, 4716 struct RUNTIME_9060 __iomem *cy_pci_addr0,
4717 void __iomem *cy_pci_addr2, int cy_pci_irq, 4717 int cy_pci_irq, struct pci_dev *pdev)
4718 struct pci_dev *pdev)
4719{ 4718{
4719 void __iomem *cy_pci_addr2;
4720 unsigned int j; 4720 unsigned int j;
4721 unsigned short cy_pci_nchan; 4721 unsigned short cy_pci_nchan;
4722 4722
4723 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win);
4724
4723 readl(&cy_pci_addr0->mail_box_0); 4725 readl(&cy_pci_addr0->mail_box_0);
4724#ifdef CY_PCI_DEBUG 4726#ifdef CY_PCI_DEBUG
4725 printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", 4727 printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n",
@@ -4816,11 +4818,6 @@ static int __init cy_detect_pci(void)
4816 unsigned short i, j, cy_pci_nchan, plx_ver; 4818 unsigned short i, j, cy_pci_nchan, plx_ver;
4817 unsigned short device_id, dev_index = 0; 4819 unsigned short device_id, dev_index = 0;
4818 __u32 mailbox; 4820 __u32 mailbox;
4819 __u32 ZeIndex = 0;
4820 void __iomem *Ze_addr0[NR_CARDS], *Ze_addr2[NR_CARDS];
4821 __u32 Ze_phys0[NR_CARDS], Ze_phys2[NR_CARDS];
4822 unsigned char Ze_irq[NR_CARDS];
4823 struct pci_dev *Ze_pdev[NR_CARDS];
4824 int retval; 4821 int retval;
4825 4822
4826 for (i = 0; i < NR_CARDS; i++) { 4823 for (i = 0; i < NR_CARDS; i++) {
@@ -5042,24 +5039,10 @@ static int __init cy_detect_pci(void)
5042 } 5039 }
5043 5040
5044 if (mailbox == ZE_V1) { 5041 if (mailbox == ZE_V1) {
5045 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win); 5042 retval = cy_init_Ze(cy_pci_phys0, cy_pci_phys2,
5046 if (ZeIndex == NR_CARDS) { 5043 cy_pci_addr0, cy_pci_irq, pdev);
5047 printk("Cyclades-Ze/PCI found at " 5044 if (retval < 0)
5048 "0x%lx but no more cards can " 5045 i--;
5049 "be used.\nChange NR_CARDS in "
5050 "cyclades.c and recompile "
5051 "kernel.\n",
5052 (ulong)cy_pci_phys2);
5053 } else {
5054 Ze_phys0[ZeIndex] = cy_pci_phys0;
5055 Ze_phys2[ZeIndex] = cy_pci_phys2;
5056 Ze_addr0[ZeIndex] = cy_pci_addr0;
5057 Ze_addr2[ZeIndex] = cy_pci_addr2;
5058 Ze_irq[ZeIndex] = cy_pci_irq;
5059 Ze_pdev[ZeIndex] = pdev;
5060 ZeIndex++;
5061 }
5062 i--;
5063 continue; 5046 continue;
5064 } else { 5047 } else {
5065 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin); 5048 cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin);
@@ -5168,32 +5151,6 @@ static int __init cy_detect_pci(void)
5168 } 5151 }
5169 } 5152 }
5170 5153
5171 for (; ZeIndex != 0 && i < NR_CARDS; i++) {
5172 cy_pci_phys0 = Ze_phys0[0];
5173 cy_pci_phys2 = Ze_phys2[0];
5174 cy_pci_addr0 = Ze_addr0[0];
5175 cy_pci_addr2 = Ze_addr2[0];
5176 cy_pci_irq = Ze_irq[0];
5177 pdev = Ze_pdev[0];
5178 for (j = 0; j < ZeIndex - 1; j++) {
5179 Ze_phys0[j] = Ze_phys0[j + 1];
5180 Ze_phys2[j] = Ze_phys2[j + 1];
5181 Ze_addr0[j] = Ze_addr0[j + 1];
5182 Ze_addr2[j] = Ze_addr2[j + 1];
5183 Ze_irq[j] = Ze_irq[j + 1];
5184 Ze_pdev[j] = Ze_pdev[j + 1];
5185 }
5186 ZeIndex--;
5187 retval = cy_init_Ze(cy_pci_phys0, cy_pci_phys2, cy_pci_addr0,
5188 cy_pci_addr2, cy_pci_irq, pdev);
5189 if (retval < 0)
5190 return i;
5191 }
5192 if (ZeIndex != 0) {
5193 printk("Cyclades-Ze/PCI found at 0x%x but no more cards can be "
5194 "used.\nChange NR_CARDS in cyclades.c and recompile "
5195 "kernel.\n", (unsigned int)Ze_phys2[0]);
5196 }
5197 return i; 5154 return i;
5198#else 5155#else
5199 return 0; 5156 return 0;