Lines Matching refs:swd

197 	struct swim_priv *swd;  member
431 struct swim __iomem *base = fs->swd->base; in swim_track()
448 struct swim __iomem *base = fs->swd->base; in floppy_eject()
464 struct swim __iomem *base = fs->swd->base; in swim_read_sector()
501 struct swim __iomem *base = fs->swd->base; in floppy_read_sectors()
594 struct swim __iomem *base = fs->swd->base; in setup_medium()
621 struct swim __iomem *base = fs->swd->base; in floppy_open()
680 struct swim __iomem *base = fs->swd->base; in floppy_release()
755 struct swim __iomem *base = fs->swd->base; in floppy_revalidate()
782 struct swim_priv *swd = data; in floppy_find() local
785 if (drive > swd->floppy_count) in floppy_find()
789 return get_disk(swd->unit[drive].disk); in floppy_find()
792 static int __devinit swim_add_floppy(struct swim_priv *swd, in swim_add_floppy() argument
795 struct floppy_state *fs = &swd->unit[swd->floppy_count]; in swim_add_floppy()
796 struct swim __iomem *base = swd->base; in swim_add_floppy()
811 swd->floppy_count++; in swim_add_floppy()
816 static int __devinit swim_floppy_init(struct swim_priv *swd) in swim_floppy_init() argument
820 struct swim __iomem *base = swd->base; in swim_floppy_init()
826 swim_add_floppy(swd, INTERNAL_DRIVE); in swim_floppy_init()
829 swim_add_floppy(swd, EXTERNAL_DRIVE); in swim_floppy_init()
840 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_floppy_init()
841 swd->unit[drive].disk = alloc_disk(1); in swim_floppy_init()
842 if (swd->unit[drive].disk == NULL) { in swim_floppy_init()
846 swd->unit[drive].swd = swd; in swim_floppy_init()
849 swd->queue = blk_init_queue(do_fd_request, &swd->lock); in swim_floppy_init()
850 if (!swd->queue) { in swim_floppy_init()
855 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_floppy_init()
856 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE; in swim_floppy_init()
857 swd->unit[drive].disk->major = FLOPPY_MAJOR; in swim_floppy_init()
858 swd->unit[drive].disk->first_minor = drive; in swim_floppy_init()
859 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive); in swim_floppy_init()
860 swd->unit[drive].disk->fops = &floppy_fops; in swim_floppy_init()
861 swd->unit[drive].disk->private_data = &swd->unit[drive]; in swim_floppy_init()
862 swd->unit[drive].disk->queue = swd->queue; in swim_floppy_init()
863 set_capacity(swd->unit[drive].disk, 2880); in swim_floppy_init()
864 add_disk(swd->unit[drive].disk); in swim_floppy_init()
868 floppy_find, NULL, swd); in swim_floppy_init()
875 put_disk(swd->unit[drive].disk); in swim_floppy_init()
883 struct swim_priv *swd; in swim_probe() local
914 swd = kzalloc(sizeof(struct swim_priv), GFP_KERNEL); in swim_probe()
915 if (!swd) { in swim_probe()
919 platform_set_drvdata(dev, swd); in swim_probe()
921 swd->base = swim_base; in swim_probe()
923 ret = swim_floppy_init(swd); in swim_probe()
931 kfree(swd); in swim_probe()
942 struct swim_priv *swd = platform_get_drvdata(dev); in swim_remove() local
948 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_remove()
949 del_gendisk(swd->unit[drive].disk); in swim_remove()
950 put_disk(swd->unit[drive].disk); in swim_remove()
955 blk_cleanup_queue(swd->queue); in swim_remove()
959 for (drive = 0; drive < swd->floppy_count; drive++) in swim_remove()
960 floppy_eject(&swd->unit[drive]); in swim_remove()
962 iounmap(swd->base); in swim_remove()
969 kfree(swd); in swim_remove()