From: David Hinds This removes dead PCI-related code from the i82365 driver. drivers/pcmcia/i82365.c | 66 ++++++++++++++++-------------------------------- 1 files changed, 23 insertions(+), 43 deletions(-) diff -puN drivers/pcmcia/i82365.c~i82365-pci-cruft-removal drivers/pcmcia/i82365.c --- 25/drivers/pcmcia/i82365.c~i82365-pci-cruft-removal 2003-12-21 22:01:53.000000000 -0800 +++ 25-akpm/drivers/pcmcia/i82365.c 2003-12-21 22:01:53.000000000 -0800 @@ -42,7 +42,6 @@ #include #include #include -#include #include #include #include @@ -188,10 +187,6 @@ static struct timer_list poll_timer; /*====================================================================*/ -/* Default settings for PCI command configuration register */ -#define CMD_DFLT (PCI_COMMAND_IO|PCI_COMMAND_MEMORY| \ - PCI_COMMAND_MASTER|PCI_COMMAND_WAIT) - /* These definitions must match the pcic table! */ typedef enum pcic_id { IS_I82365A, IS_I82365B, IS_I82365DF, @@ -202,15 +197,10 @@ typedef enum pcic_id { /* Flags for classifying groups of controllers */ #define IS_VADEM 0x0001 #define IS_CIRRUS 0x0002 -#define IS_TI 0x0004 -#define IS_O2MICRO 0x0008 #define IS_VIA 0x0010 -#define IS_TOPIC 0x0020 -#define IS_RICOH 0x0040 #define IS_UNKNOWN 0x0400 #define IS_VG_PWR 0x0800 #define IS_DF_PWR 0x1000 -#define IS_PCI 0x2000 #define IS_ALIVE 0x8000 typedef struct pcic_t { @@ -351,26 +341,24 @@ static u_int __init cirrus_set_opts(u_sh if (has_ring == -1) has_ring = 1; flip(p->misc2, PD67_MC2_IRQ15_RI, has_ring); flip(p->misc2, PD67_MC2_DYNAMIC_MODE, dynamic_mode); + flip(p->misc2, PD67_MC2_FREQ_BYPASS, freq_bypass); if (p->misc2 & PD67_MC2_IRQ15_RI) strcat(buf, " [ring]"); if (p->misc2 & PD67_MC2_DYNAMIC_MODE) strcat(buf, " [dyn mode]"); + if (p->misc2 & PD67_MC2_FREQ_BYPASS) + strcat(buf, " [freq bypass]"); if (p->misc1 & PD67_MC1_INPACK_ENA) strcat(buf, " [inpack]"); - if (!(t->flags & IS_PCI)) { - if (p->misc2 & PD67_MC2_IRQ15_RI) - mask &= ~0x8000; - if (has_led > 0) { - strcat(buf, " [led]"); - mask &= ~0x1000; - } - if (has_dma > 0) { - strcat(buf, " [dma]"); - mask &= ~0x0600; - flip(p->misc2, PD67_MC2_FREQ_BYPASS, freq_bypass); - if (p->misc2 & PD67_MC2_FREQ_BYPASS) - strcat(buf, " [freq bypass]"); - } + if (p->misc2 & PD67_MC2_IRQ15_RI) + mask &= ~0x8000; + if (has_led > 0) { + strcat(buf, " [led]"); + mask &= ~0x1000; + } + if (has_dma > 0) { + strcat(buf, " [dma]"); + mask &= ~0x0600; } if (!(t->flags & IS_VIA)) { if (setup_time >= 0) @@ -540,7 +528,6 @@ static u_int __init test_irq(u_short soc return (irq_hits != 1); } - static u_int __init isa_scan(u_short sock, u_int mask0) { u_int mask1 = 0; @@ -585,7 +572,6 @@ static u_int __init isa_scan(u_short soc return mask1; } - /*====================================================================*/ /* Time conversion functions */ @@ -597,7 +583,6 @@ static int to_cycles(int ns) /*====================================================================*/ - static int __init identify(u_short port, u_short sock) { u_char val; @@ -700,7 +685,7 @@ static void __init add_socket(u_short po static void __init add_pcic(int ns, int type) { u_int mask = 0, i, base; - int use_pci = 0, isa_irq = 0; + int isa_irq = 0; struct i82365_socket *t = &socket[sockets-ns]; base = sockets-ns; @@ -721,17 +706,16 @@ static void __init add_pcic(int ns, int mask &= I365_MASK & set_bridge_opts(base, ns); /* Scan for ISA interrupts */ mask = isa_scan(base, mask); - printk(KERN_INFO " PCI card interrupts,"); /* Poll if only two interrupts available */ - if (!use_pci && !poll_interval) { + if (!poll_interval) { u_int tmp = (mask & 0xff20); tmp = tmp & (tmp-1); if ((tmp & (tmp-1)) == 0) poll_interval = HZ; } /* Only try an ISA cs_irq if this is the first controller */ - if (!use_pci && !grab_irq && (cs_irq || !poll_interval)) { + if (!grab_irq && (cs_irq || !poll_interval)) { /* Avoid irq 12 unless it is explicitly requested */ u_int cs_mask = mask & ((cs_irq) ? (1< 0; cs_irq--) @@ -745,7 +729,7 @@ static void __init add_pcic(int ns, int } } - if (!use_pci && !isa_irq) { + if (!isa_irq) { if (poll_interval == 0) poll_interval = HZ; printk(" polling interval = %d ms\n", @@ -763,10 +747,8 @@ static void __init add_pcic(int ns, int } /* add_pcic */ - /*====================================================================*/ - #ifdef CONFIG_PNP static struct isapnp_device_id id_table[] __initdata = { { ISAPNP_ANY_ID, ISAPNP_ANY_ID, ISAPNP_VENDOR('P', 'N', 'P'), @@ -832,7 +814,9 @@ static void __init isa_probe(void) } } } else { - for (i = 0; i < (extra_sockets ? 8 : 4); i += 2) { + for (i = 0; i < 8; i += 2) { + if (sockets && !extra_sockets && (i == 4)) + break; port = i365_base + 2*(i>>2); sock = (i & 3); id = identify(port, sock); @@ -856,7 +840,6 @@ static void __init isa_probe(void) } } - /*====================================================================*/ static irqreturn_t pcic_interrupt(int irq, void *dev, @@ -872,8 +855,7 @@ static irqreturn_t pcic_interrupt(int ir for (j = 0; j < 20; j++) { active = 0; for (i = 0; i < sockets; i++) { - if ((socket[i].cs_irq != irq) && - (socket[i].socket.pci_irq != irq)) + if (socket[i].cs_irq != irq) continue; handled = 1; ISA_LOCK(i, flags); @@ -911,7 +893,6 @@ static irqreturn_t pcic_interrupt(int ir static void pcic_interrupt_wrapper(u_long data) { pcic_interrupt(0, NULL, NULL); - init_timer(&poll_timer); poll_timer.expires = jiffies + poll_interval; add_timer(&poll_timer); } @@ -1039,7 +1020,7 @@ static int i365_set_socket(u_short sock, /* IO card, RESET flag, IO interrupt */ reg = t->intr; - if (state->io_irq != t->socket.pci_irq) reg |= state->io_irq; + reg |= state->io_irq; reg |= (state->flags & SS_RESET) ? 0 : I365_PC_RESET; reg |= (state->flags & SS_IOCARD) ? I365_PC_IOCARD : 0; i365_set(sock, I365_INTCTL, reg); @@ -1177,8 +1158,7 @@ static int i365_set_mem_map(u_short sock if ((map > 4) || (mem->card_start > 0x3ffffff) || (mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) return -EINVAL; - if (!(socket[sock].flags & IS_PCI) && - ((mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff))) + if ((mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff)) return -EINVAL; /* Turn off the window before changing anything */ @@ -1387,7 +1367,7 @@ static int __init init_i82365(void) if (driver_register(&i82365_driver)) return -1; - printk(KERN_INFO "Intel PCIC probe: "); + printk(KERN_INFO "Intel ISA PCIC probe: "); sockets = 0; isa_probe(); _