Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6

* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
pcmcia: fix error handling in cm4000_cs.c
drivers/pcmcia: Add missing local_irq_restore
serial_cs: MD55x support (PCMCIA GPRS/EDGE modem) (kernel 2.6.33)
pcmcia: avoid late calls to pccard_validate_cis
pcmcia: fix ioport size calculation in rsrc_nonstatic
pcmcia: re-start on MFC override
pcmcia: fix io_probe due to parent (PCI) resources
pcmcia: use previously assigned IRQ for all card functions

+55 -23
+5 -3
drivers/char/pcmcia/cm4000_cs.c
··· 1026 1026 1027 1027 xoutb(0, REG_FLAGS1(iobase)); /* clear detectCMM */ 1028 1028 /* last check before exit */ 1029 - if (!io_detect_cm4000(iobase, dev)) 1030 - count = -ENODEV; 1029 + if (!io_detect_cm4000(iobase, dev)) { 1030 + rc = -ENODEV; 1031 + goto release_io; 1032 + } 1031 1033 1032 1034 if (test_bit(IS_INVREV, &dev->flags) && count > 0) 1033 1035 str_invert_revert(dev->rbuf, count); 1034 1036 1035 1037 if (copy_to_user(buf, dev->rbuf, count)) 1036 - return -EFAULT; 1038 + rc = -EFAULT; 1037 1039 1038 1040 release_io: 1039 1041 clear_bit(LOCK_IO, &dev->flags);
+7 -2
drivers/pcmcia/cistpl.c
··· 1484 1484 if (!s) 1485 1485 return -EINVAL; 1486 1486 1487 + if (s->functions) { 1488 + WARN_ON(1); 1489 + return -EINVAL; 1490 + } 1491 + 1487 1492 /* We do not want to validate the CIS cache... */ 1488 1493 mutex_lock(&s->ops_mutex); 1489 1494 destroy_cis_cache(s); ··· 1644 1639 count = 0; 1645 1640 else { 1646 1641 struct pcmcia_socket *s; 1647 - unsigned int chains; 1642 + unsigned int chains = 1; 1648 1643 1649 1644 if (off + count > size) 1650 1645 count = size - off; ··· 1653 1648 1654 1649 if (!(s->state & SOCKET_PRESENT)) 1655 1650 return -ENODEV; 1656 - if (pccard_validate_cis(s, &chains)) 1651 + if (!s->functions && pccard_validate_cis(s, &chains)) 1657 1652 return -EIO; 1658 1653 if (!chains) 1659 1654 return -ENODATA;
+3 -1
drivers/pcmcia/db1xxx_ss.c
··· 166 166 167 167 ret = request_irq(sock->insert_irq, db1200_pcmcia_cdirq, 168 168 IRQF_DISABLED, "pcmcia_insert", sock); 169 - if (ret) 169 + if (ret) { 170 + local_irq_restore(flags); 170 171 goto out1; 172 + } 171 173 172 174 ret = request_irq(sock->eject_irq, db1200_pcmcia_cdirq, 173 175 IRQF_DISABLED, "pcmcia_eject", sock);
+14 -8
drivers/pcmcia/ds.c
··· 687 687 new_funcs = mfc.nfn; 688 688 else 689 689 new_funcs = 1; 690 - if (old_funcs > new_funcs) { 690 + if (old_funcs != new_funcs) { 691 + /* we need to re-start */ 691 692 pcmcia_card_remove(s, NULL); 692 693 pcmcia_card_add(s); 693 - } else if (new_funcs > old_funcs) { 694 - s->functions = new_funcs; 695 - pcmcia_device_add(s, 1); 696 694 } 697 695 } 698 696 ··· 726 728 struct pcmcia_socket *s = dev->socket; 727 729 const struct firmware *fw; 728 730 int ret = -ENOMEM; 731 + cistpl_longlink_mfc_t mfc; 732 + int old_funcs, new_funcs = 1; 729 733 730 734 if (!filename) 731 735 return -EINVAL; ··· 750 750 goto release; 751 751 } 752 752 753 + /* we need to re-start if the number of functions changed */ 754 + old_funcs = s->functions; 755 + if (!pccard_read_tuple(s, BIND_FN_ALL, CISTPL_LONGLINK_MFC, 756 + &mfc)) 757 + new_funcs = mfc.nfn; 758 + 759 + if (old_funcs != new_funcs) 760 + ret = -EBUSY; 753 761 754 762 /* update information */ 755 763 pcmcia_device_query(dev); ··· 866 858 if (did->match_flags & PCMCIA_DEV_ID_MATCH_FAKE_CIS) { 867 859 dev_dbg(&dev->dev, "device needs a fake CIS\n"); 868 860 if (!dev->socket->fake_cis) 869 - pcmcia_load_firmware(dev, did->cisfile); 870 - 871 - if (!dev->socket->fake_cis) 872 - return 0; 861 + if (pcmcia_load_firmware(dev, did->cisfile)) 862 + return 0; 873 863 } 874 864 875 865 if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
+5 -5
drivers/pcmcia/pcmcia_resource.c
··· 755 755 else 756 756 printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n"); 757 757 758 - #ifdef CONFIG_PCMCIA_PROBE 759 - 760 - if (s->irq.AssignedIRQ != 0) { 761 - /* If the interrupt is already assigned, it must be the same */ 758 + /* If the interrupt is already assigned, it must be the same */ 759 + if (s->irq.AssignedIRQ != 0) 762 760 irq = s->irq.AssignedIRQ; 763 - } else { 761 + 762 + #ifdef CONFIG_PCMCIA_PROBE 763 + if (!irq) { 764 764 int try; 765 765 u32 mask = s->irq_mask; 766 766 void *data = p_dev; /* something unique to this device */
+12 -4
drivers/pcmcia/rsrc_nonstatic.c
··· 214 214 return; 215 215 } 216 216 for (i = base, most = 0; i < base+num; i += 8) { 217 - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 217 + res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 218 218 if (!res) 219 219 continue; 220 220 hole = inb(i); ··· 231 231 232 232 bad = any = 0; 233 233 for (i = base; i < base+num; i += 8) { 234 - res = claim_region(NULL, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 235 - if (!res) 234 + res = claim_region(s, i, 8, IORESOURCE_IO, "PCMCIA ioprobe"); 235 + if (!res) { 236 + if (!any) 237 + printk(" excluding"); 238 + if (!bad) 239 + bad = any = i; 236 240 continue; 241 + } 237 242 for (j = 0; j < 8; j++) 238 243 if (inb(i+j) != most) 239 244 break; ··· 258 253 } 259 254 if (bad) { 260 255 if ((num > 16) && (bad == base) && (i == base+num)) { 256 + sub_interval(&s_data->io_db, bad, i-bad); 261 257 printk(" nothing: probe failed.\n"); 262 258 return; 263 259 } else { ··· 810 804 static int adjust_io(struct pcmcia_socket *s, unsigned int action, unsigned long start, unsigned long end) 811 805 { 812 806 struct socket_data *data = s->resource_data; 813 - unsigned long size = end - start + 1; 807 + unsigned long size; 814 808 int ret = 0; 815 809 816 810 #if defined(CONFIG_X86) ··· 819 813 if (start < 0x100) 820 814 start = 0x100; 821 815 #endif 816 + 817 + size = end - start + 1; 822 818 823 819 if (end < start) 824 820 return -EINVAL;
+9
drivers/serial/serial_cs.c
··· 105 105 * manfid 0x0160, 0x0104 106 106 * This card appears to have a 14.7456MHz clock. 107 107 */ 108 + /* Generic Modem: MD55x (GPRS/EDGE) have 109 + * Elan VPU16551 UART with 14.7456MHz oscillator 110 + * manfid 0x015D, 0x4C45 111 + */ 108 112 static void quirk_setup_brainboxes_0104(struct pcmcia_device *link, struct uart_port *port) 109 113 { 110 114 port->uartclk = 14745600; ··· 197 193 { 198 194 .manfid = 0x0160, 199 195 .prodid = 0x0104, 196 + .multi = -1, 197 + .setup = quirk_setup_brainboxes_0104, 198 + }, { 199 + .manfid = 0x015D, 200 + .prodid = 0x4C45, 200 201 .multi = -1, 201 202 .setup = quirk_setup_brainboxes_0104, 202 203 }, {