Lines Matching refs:jm
798 struct jmb38x_ms *jm = dev_get_drvdata(dev); in jmb38x_ms_suspend() local
802 for (cnt = 0; cnt < jm->host_cnt; ++cnt) { in jmb38x_ms_suspend()
803 if (!jm->hosts[cnt]) in jmb38x_ms_suspend()
805 memstick_suspend_host(jm->hosts[cnt]); in jmb38x_ms_suspend()
815 struct jmb38x_ms *jm = dev_get_drvdata(dev); in jmb38x_ms_resume() local
820 for (rc = 0; rc < jm->host_cnt; ++rc) { in jmb38x_ms_resume()
821 if (!jm->hosts[rc]) in jmb38x_ms_resume()
823 memstick_resume_host(jm->hosts[rc]); in jmb38x_ms_resume()
824 memstick_detect_change(jm->hosts[rc]); in jmb38x_ms_resume()
846 static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt) in jmb38x_ms_alloc_host() argument
852 &jm->pdev->dev); in jmb38x_ms_alloc_host()
858 host->chip = jm; in jmb38x_ms_alloc_host()
859 host->addr = ioremap(pci_resource_start(jm->pdev, cnt), in jmb38x_ms_alloc_host()
860 pci_resource_len(jm->pdev, cnt)); in jmb38x_ms_alloc_host()
868 host->irq = jm->pdev->irq; in jmb38x_ms_alloc_host()
901 struct jmb38x_ms *jm; in jmb38x_ms_probe() local
930 jm = kzalloc(sizeof(struct jmb38x_ms) in jmb38x_ms_probe()
932 if (!jm) { in jmb38x_ms_probe()
937 jm->pdev = pdev; in jmb38x_ms_probe()
938 jm->host_cnt = cnt; in jmb38x_ms_probe()
939 pci_set_drvdata(pdev, jm); in jmb38x_ms_probe()
941 for (cnt = 0; cnt < jm->host_cnt; ++cnt) { in jmb38x_ms_probe()
942 jm->hosts[cnt] = jmb38x_ms_alloc_host(jm, cnt); in jmb38x_ms_probe()
943 if (!jm->hosts[cnt]) in jmb38x_ms_probe()
946 rc = memstick_add_host(jm->hosts[cnt]); in jmb38x_ms_probe()
949 jmb38x_ms_free_host(jm->hosts[cnt]); in jmb38x_ms_probe()
950 jm->hosts[cnt] = NULL; in jmb38x_ms_probe()
961 kfree(jm); in jmb38x_ms_probe()
972 struct jmb38x_ms *jm = pci_get_drvdata(dev); in jmb38x_ms_remove() local
977 for (cnt = 0; cnt < jm->host_cnt; ++cnt) { in jmb38x_ms_remove()
978 if (!jm->hosts[cnt]) in jmb38x_ms_remove()
981 host = memstick_priv(jm->hosts[cnt]); in jmb38x_ms_remove()
983 jm->hosts[cnt]->request = jmb38x_ms_dummy_submit; in jmb38x_ms_remove()
987 dev_dbg(&jm->pdev->dev, "interrupts off\n"); in jmb38x_ms_remove()
991 jmb38x_ms_complete_cmd(jm->hosts[cnt], 1); in jmb38x_ms_remove()
995 memstick_remove_host(jm->hosts[cnt]); in jmb38x_ms_remove()
996 dev_dbg(&jm->pdev->dev, "host removed\n"); in jmb38x_ms_remove()
998 jmb38x_ms_free_host(jm->hosts[cnt]); in jmb38x_ms_remove()
1006 kfree(jm); in jmb38x_ms_remove()