--- zzzz-none-000/linux-2.6.19.2/drivers/pcmcia/au1000_generic.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/drivers/pcmcia/au1000_generic.c 2007-01-11 07:38:19.000000000 +0000 @@ -351,7 +351,6 @@ int au1x00_pcmcia_socket_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr) { struct skt_dev_info *sinfo; - struct au1000_pcmcia_socket *skt; int ret, i; sinfo = kzalloc(sizeof(struct skt_dev_info), GFP_KERNEL); @@ -366,7 +365,7 @@ * Initialise the per-socket structure. */ for (i = 0; i < nr; i++) { - skt = PCMCIA_SOCKET(i); + struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i); memset(skt, 0, sizeof(*skt)); skt->socket.resource_ops = &pccard_static_ops; @@ -439,29 +438,17 @@ dev_set_drvdata(dev, sinfo); return 0; - -out_err: - flush_scheduled_work(); - ops->hw_shutdown(skt); - while (i-- > 0) { - skt = PCMCIA_SOCKET(i); + do { + struct au1000_pcmcia_socket *skt = PCMCIA_SOCKET(i); del_timer_sync(&skt->poll_timer); pcmcia_unregister_socket(&skt->socket); +out_err: flush_scheduled_work(); - if (i == 0) { - iounmap(skt->virt_io + (u32)mips_io_port_base); - skt->virt_io = NULL; - } -#ifndef CONFIG_MIPS_XXS1500 - else { - iounmap(skt->virt_io + (u32)mips_io_port_base); - skt->virt_io = NULL; - } -#endif ops->hw_shutdown(skt); - } + i--; + } while (i > 0); kfree(sinfo); out: return ret;