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(struct_size(jm, hosts, cnt), GFP_KERNEL); in jmb38x_ms_probe()
931 if (!jm) { in jmb38x_ms_probe()
936 jm->pdev = pdev; in jmb38x_ms_probe()
937 jm->host_cnt = cnt; in jmb38x_ms_probe()
938 pci_set_drvdata(pdev, jm); in jmb38x_ms_probe()
940 for (cnt = 0; cnt < jm->host_cnt; ++cnt) { in jmb38x_ms_probe()
941 jm->hosts[cnt] = jmb38x_ms_alloc_host(jm, cnt); in jmb38x_ms_probe()
942 if (!jm->hosts[cnt]) in jmb38x_ms_probe()
945 rc = memstick_add_host(jm->hosts[cnt]); in jmb38x_ms_probe()
948 jmb38x_ms_free_host(jm->hosts[cnt]); in jmb38x_ms_probe()
949 jm->hosts[cnt] = NULL; in jmb38x_ms_probe()
960 kfree(jm); in jmb38x_ms_probe()
971 struct jmb38x_ms *jm = pci_get_drvdata(dev); in jmb38x_ms_remove() local
976 for (cnt = 0; cnt < jm->host_cnt; ++cnt) { in jmb38x_ms_remove()
977 if (!jm->hosts[cnt]) in jmb38x_ms_remove()
980 host = memstick_priv(jm->hosts[cnt]); in jmb38x_ms_remove()
982 jm->hosts[cnt]->request = jmb38x_ms_dummy_submit; in jmb38x_ms_remove()
986 dev_dbg(&jm->pdev->dev, "interrupts off\n"); in jmb38x_ms_remove()
990 jmb38x_ms_complete_cmd(jm->hosts[cnt], 1); in jmb38x_ms_remove()
994 memstick_remove_host(jm->hosts[cnt]); in jmb38x_ms_remove()
995 dev_dbg(&jm->pdev->dev, "host removed\n"); in jmb38x_ms_remove()
997 jmb38x_ms_free_host(jm->hosts[cnt]); in jmb38x_ms_remove()
1005 kfree(jm); in jmb38x_ms_remove()