diff options
Diffstat (limited to 'drivers/block/swim.c')
-rw-r--r-- | drivers/block/swim.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/swim.c b/drivers/block/swim.c index 75333d0a3327..24a482f2fbd6 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c | |||
@@ -741,11 +741,12 @@ static int floppy_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
741 | return 0; | 741 | return 0; |
742 | } | 742 | } |
743 | 743 | ||
744 | static int floppy_check_change(struct gendisk *disk) | 744 | static unsigned int floppy_check_events(struct gendisk *disk, |
745 | unsigned int clearing) | ||
745 | { | 746 | { |
746 | struct floppy_state *fs = disk->private_data; | 747 | struct floppy_state *fs = disk->private_data; |
747 | 748 | ||
748 | return fs->ejected; | 749 | return fs->ejected ? DISK_EVENT_MEDIA_CHANGE : 0; |
749 | } | 750 | } |
750 | 751 | ||
751 | static int floppy_revalidate(struct gendisk *disk) | 752 | static int floppy_revalidate(struct gendisk *disk) |
@@ -772,7 +773,7 @@ static const struct block_device_operations floppy_fops = { | |||
772 | .release = floppy_release, | 773 | .release = floppy_release, |
773 | .ioctl = floppy_ioctl, | 774 | .ioctl = floppy_ioctl, |
774 | .getgeo = floppy_getgeo, | 775 | .getgeo = floppy_getgeo, |
775 | .media_changed = floppy_check_change, | 776 | .check_events = floppy_check_events, |
776 | .revalidate_disk = floppy_revalidate, | 777 | .revalidate_disk = floppy_revalidate, |
777 | }; | 778 | }; |
778 | 779 | ||
@@ -857,6 +858,7 @@ static int __devinit swim_floppy_init(struct swim_priv *swd) | |||
857 | swd->unit[drive].disk->first_minor = drive; | 858 | swd->unit[drive].disk->first_minor = drive; |
858 | sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive); | 859 | sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive); |
859 | swd->unit[drive].disk->fops = &floppy_fops; | 860 | swd->unit[drive].disk->fops = &floppy_fops; |
861 | swd->unit[drive].disk->events = DISK_EVENT_MEDIA_CHANGE; | ||
860 | swd->unit[drive].disk->private_data = &swd->unit[drive]; | 862 | swd->unit[drive].disk->private_data = &swd->unit[drive]; |
861 | swd->unit[drive].disk->queue = swd->queue; | 863 | swd->unit[drive].disk->queue = swd->queue; |
862 | set_capacity(swd->unit[drive].disk, 2880); | 864 | set_capacity(swd->unit[drive].disk, 2880); |