Commit 2b1da41f authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

Char: cyclades, init Ze immediately

There will be no other choice after introducing pci probing anyway.
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 38d09093
...@@ -4714,12 +4714,14 @@ static void plx_init(void __iomem * addr, __u32 initctl) ...@@ -4714,12 +4714,14 @@ static void plx_init(void __iomem * addr, __u32 initctl)
static int __devinit cy_init_Ze(unsigned long cy_pci_phys0, static int __devinit cy_init_Ze(unsigned long cy_pci_phys0,
unsigned long cy_pci_phys2, unsigned long cy_pci_phys2,
struct RUNTIME_9060 __iomem *cy_pci_addr0, struct RUNTIME_9060 __iomem *cy_pci_addr0,
void __iomem *cy_pci_addr2, int cy_pci_irq, int cy_pci_irq, struct pci_dev *pdev)
struct pci_dev *pdev)
{ {
void __iomem *cy_pci_addr2;
unsigned int j; unsigned int j;
unsigned short cy_pci_nchan; unsigned short cy_pci_nchan;
cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win);
readl(&cy_pci_addr0->mail_box_0); readl(&cy_pci_addr0->mail_box_0);
#ifdef CY_PCI_DEBUG #ifdef CY_PCI_DEBUG
printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n", printk("Cyclades-Z/PCI: relocate winaddr=0x%lx ctladdr=0x%lx\n",
...@@ -4816,11 +4818,6 @@ static int __init cy_detect_pci(void) ...@@ -4816,11 +4818,6 @@ static int __init cy_detect_pci(void)
unsigned short i, j, cy_pci_nchan, plx_ver; unsigned short i, j, cy_pci_nchan, plx_ver;
unsigned short device_id, dev_index = 0; unsigned short device_id, dev_index = 0;
__u32 mailbox; __u32 mailbox;
__u32 ZeIndex = 0;
void __iomem *Ze_addr0[NR_CARDS], *Ze_addr2[NR_CARDS];
__u32 Ze_phys0[NR_CARDS], Ze_phys2[NR_CARDS];
unsigned char Ze_irq[NR_CARDS];
struct pci_dev *Ze_pdev[NR_CARDS];
int retval; int retval;
for (i = 0; i < NR_CARDS; i++) { for (i = 0; i < NR_CARDS; i++) {
...@@ -5042,24 +5039,10 @@ static int __init cy_detect_pci(void) ...@@ -5042,24 +5039,10 @@ static int __init cy_detect_pci(void)
} }
if (mailbox == ZE_V1) { if (mailbox == ZE_V1) {
cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Ze_win); retval = cy_init_Ze(cy_pci_phys0, cy_pci_phys2,
if (ZeIndex == NR_CARDS) { cy_pci_addr0, cy_pci_irq, pdev);
printk("Cyclades-Ze/PCI found at " if (retval < 0)
"0x%lx but no more cards can " i--;
"be used.\nChange NR_CARDS in "
"cyclades.c and recompile "
"kernel.\n",
(ulong)cy_pci_phys2);
} else {
Ze_phys0[ZeIndex] = cy_pci_phys0;
Ze_phys2[ZeIndex] = cy_pci_phys2;
Ze_addr0[ZeIndex] = cy_pci_addr0;
Ze_addr2[ZeIndex] = cy_pci_addr2;
Ze_irq[ZeIndex] = cy_pci_irq;
Ze_pdev[ZeIndex] = pdev;
ZeIndex++;
}
i--;
continue; continue;
} else { } else {
cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin); cy_pci_addr2 = pci_iomap(pdev, 2, CyPCI_Zwin);
...@@ -5168,32 +5151,6 @@ static int __init cy_detect_pci(void) ...@@ -5168,32 +5151,6 @@ static int __init cy_detect_pci(void)
} }
} }
for (; ZeIndex != 0 && i < NR_CARDS; i++) {
cy_pci_phys0 = Ze_phys0[0];
cy_pci_phys2 = Ze_phys2[0];
cy_pci_addr0 = Ze_addr0[0];
cy_pci_addr2 = Ze_addr2[0];
cy_pci_irq = Ze_irq[0];
pdev = Ze_pdev[0];
for (j = 0; j < ZeIndex - 1; j++) {
Ze_phys0[j] = Ze_phys0[j + 1];
Ze_phys2[j] = Ze_phys2[j + 1];
Ze_addr0[j] = Ze_addr0[j + 1];
Ze_addr2[j] = Ze_addr2[j + 1];
Ze_irq[j] = Ze_irq[j + 1];
Ze_pdev[j] = Ze_pdev[j + 1];
}
ZeIndex--;
retval = cy_init_Ze(cy_pci_phys0, cy_pci_phys2, cy_pci_addr0,
cy_pci_addr2, cy_pci_irq, pdev);
if (retval < 0)
return i;
}
if (ZeIndex != 0) {
printk("Cyclades-Ze/PCI found at 0x%x but no more cards can be "
"used.\nChange NR_CARDS in cyclades.c and recompile "
"kernel.\n", (unsigned int)Ze_phys2[0]);
}
return i; return i;
#else #else
return 0; return 0;
......
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