Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
pcmcia: ensure correct logging in do_io_probe
pcmcia: add another pata/ide ID
pcmcia: add braces in error path
pcmcia: struct device - replace bus_id with dev_name(), dev_set_name()
pcmcia: setup resource information for pseudo multifunction devices.
pcmcia: fix indentation & braces disagreement - add braces

+21 -17
+1
drivers/ide/ide-cs.c
··· 444 444 PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209), 445 445 PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e), 446 446 PCMCIA_MFC_DEVICE_PROD_ID12(1, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6), 447 + PCMCIA_DEVICE_PROD_ID2("Flash Card", 0x5a362506), 447 448 PCMCIA_DEVICE_NULL, 448 449 }; 449 450 MODULE_DEVICE_TABLE(pcmcia, ide_ids);
+2 -1
drivers/pcmcia/cistpl.c
··· 351 351 char *buf; 352 352 353 353 buf = kmalloc(256, GFP_KERNEL); 354 - if (buf == NULL) 354 + if (buf == NULL) { 355 355 dev_printk(KERN_WARNING, &s->dev, 356 356 "no memory for verifying CIS\n"); 357 357 return -ENOMEM; 358 + } 358 359 list_for_each_entry(cis, &s->cis_cache, node) { 359 360 int len = cis->len; 360 361
+7 -7
drivers/pcmcia/cs.c
··· 186 186 187 187 spin_lock_init(&socket->lock); 188 188 189 - if (socket->resource_ops->init) { 190 - ret = socket->resource_ops->init(socket); 191 - if (ret) 192 - return (ret); 193 - } 194 - 195 189 /* try to obtain a socket number [yes, it gets ugly if we 196 190 * register more than 2^sizeof(unsigned int) pcmcia 197 191 * sockets... but the socket number is deprecated ··· 220 226 /* set proper values in socket->dev */ 221 227 dev_set_drvdata(&socket->dev, socket); 222 228 socket->dev.class = &pcmcia_socket_class; 223 - snprintf(socket->dev.bus_id, BUS_ID_SIZE, "pcmcia_socket%u", socket->sock); 229 + dev_set_name(&socket->dev, "pcmcia_socket%u", socket->sock); 224 230 225 231 /* base address = 0, map = 0 */ 226 232 socket->cis_mem.flags = 0; ··· 232 238 init_completion(&socket->thread_done); 233 239 mutex_init(&socket->skt_mutex); 234 240 spin_lock_init(&socket->thread_lock); 241 + 242 + if (socket->resource_ops->init) { 243 + ret = socket->resource_ops->init(socket); 244 + if (ret) 245 + goto err; 246 + } 235 247 236 248 tsk = kthread_run(pccardd, socket, "pccardd"); 237 249 if (IS_ERR(tsk)) {
+6 -5
drivers/pcmcia/ds.c
··· 622 622 { 623 623 struct pcmcia_device *p_dev, *tmp_dev; 624 624 unsigned long flags; 625 - int bus_id_len; 626 625 627 626 s = pcmcia_get_socket(s); 628 627 if (!s) ··· 649 650 /* by default don't allow DMA */ 650 651 p_dev->dma_mask = DMA_MASK_NONE; 651 652 p_dev->dev.dma_mask = &p_dev->dma_mask; 652 - bus_id_len = sprintf (p_dev->dev.bus_id, "%d.%d", p_dev->socket->sock, p_dev->device_no); 653 - 654 - p_dev->devname = kmalloc(6 + bus_id_len + 1, GFP_KERNEL); 653 + dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no); 654 + if (!dev_name(&p_dev->dev)) 655 + goto err_free; 656 + p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev)); 655 657 if (!p_dev->devname) 656 658 goto err_free; 657 - sprintf (p_dev->devname, "pcmcia%s", p_dev->dev.bus_id); 658 659 ds_dev_dbg(3, &p_dev->dev, "devname is %s\n", p_dev->devname); 659 660 660 661 spin_lock_irqsave(&pcmcia_dev_list_lock, flags); ··· 667 668 list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list) 668 669 if (p_dev->func == tmp_dev->func) { 669 670 p_dev->function_config = tmp_dev->function_config; 671 + p_dev->io = tmp_dev->io; 672 + p_dev->irq = tmp_dev->irq; 670 673 kref_get(&p_dev->function_config->ref); 671 674 } 672 675
+2 -1
drivers/pcmcia/pcmcia_resource.c
··· 302 302 /* We only allow changing Vpp1 and Vpp2 to the same value */ 303 303 if ((mod->Attributes & CONF_VPP1_CHANGE_VALID) && 304 304 (mod->Attributes & CONF_VPP2_CHANGE_VALID)) { 305 - if (mod->Vpp1 != mod->Vpp2) 305 + if (mod->Vpp1 != mod->Vpp2) { 306 306 ds_dbg(s, 0, "Vpp1 and Vpp2 must be the same\n"); 307 307 return -EINVAL; 308 + } 308 309 s->socket.Vpp = mod->Vpp1; 309 310 if (s->ops->set_socket(s, &s->socket)) { 310 311 dev_printk(KERN_WARNING, &s->dev,
+3 -3
drivers/pcmcia/rsrc_nonstatic.c
··· 71 71 ======================================================================*/ 72 72 73 73 static struct resource * 74 - make_resource(resource_size_t b, resource_size_t n, int flags, char *name) 74 + make_resource(resource_size_t b, resource_size_t n, int flags, const char *name) 75 75 { 76 76 struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); 77 77 ··· 624 624 static struct resource *nonstatic_find_io_region(unsigned long base, int num, 625 625 unsigned long align, struct pcmcia_socket *s) 626 626 { 627 - struct resource *res = make_resource(0, num, IORESOURCE_IO, s->dev.bus_id); 627 + struct resource *res = make_resource(0, num, IORESOURCE_IO, dev_name(&s->dev)); 628 628 struct socket_data *s_data = s->resource_data; 629 629 struct pcmcia_align_data data; 630 630 unsigned long min = base; ··· 658 658 static struct resource * nonstatic_find_mem_region(u_long base, u_long num, 659 659 u_long align, int low, struct pcmcia_socket *s) 660 660 { 661 - struct resource *res = make_resource(0, num, IORESOURCE_MEM, s->dev.bus_id); 661 + struct resource *res = make_resource(0, num, IORESOURCE_MEM, dev_name(&s->dev)); 662 662 struct socket_data *s_data = s->resource_data; 663 663 struct pcmcia_align_data data; 664 664 unsigned long min, max;