453 goto err;
454
455 }
456
457 result = mmc_add_host(mmc);
458
459 if (!result) {
460 dev_dbg(dev, "mmc host registered\n");
461 return 0;
462 }
463
464err:
465 if (iobase)
466 iounmap(iobase);
467 if (mmc)
468 mmc_free_host(mmc);
469
470 return result;
471}
472
473
474static int sdricoh_pcmcia_probe(struct pcmcia_device *pcmcia_dev)
475{
476 struct pci_dev *pci_dev = NULL;
477
478 dev_info(&pcmcia_dev->dev, "Searching MMC controller for pcmcia device"
479 " %s %s ...\n", pcmcia_dev->prod_id[0], pcmcia_dev->prod_id[1]);
480
481
482
483 while ((pci_dev =
484 pci_get_device(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_RL5C476,
485 pci_dev))) {
486
487 if (!sdricoh_init_mmc(pci_dev, pcmcia_dev)) {
488 dev_info(&pcmcia_dev->dev, "MMC controller found\n");
489 return 0;
490 }
491
492 }
493 dev_err(&pcmcia_dev->dev, "No MMC controller was found.\n");