aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/swim3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/swim3.c')
-rw-r--r--drivers/block/swim3.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index bf3a5b859299..4c10f56facbf 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -250,7 +250,8 @@ static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
250 unsigned int cmd, unsigned long param); 250 unsigned int cmd, unsigned long param);
251static int floppy_open(struct block_device *bdev, fmode_t mode); 251static int floppy_open(struct block_device *bdev, fmode_t mode);
252static int floppy_release(struct gendisk *disk, fmode_t mode); 252static int floppy_release(struct gendisk *disk, fmode_t mode);
253static int floppy_check_change(struct gendisk *disk); 253static unsigned int floppy_check_events(struct gendisk *disk,
254 unsigned int clearing);
254static int floppy_revalidate(struct gendisk *disk); 255static int floppy_revalidate(struct gendisk *disk);
255 256
256static bool swim3_end_request(int err, unsigned int nr_bytes) 257static bool swim3_end_request(int err, unsigned int nr_bytes)
@@ -975,10 +976,11 @@ static int floppy_release(struct gendisk *disk, fmode_t mode)
975 return 0; 976 return 0;
976} 977}
977 978
978static int floppy_check_change(struct gendisk *disk) 979static unsigned int floppy_check_events(struct gendisk *disk,
980 unsigned int clearing)
979{ 981{
980 struct floppy_state *fs = disk->private_data; 982 struct floppy_state *fs = disk->private_data;
981 return fs->ejected; 983 return fs->ejected ? DISK_EVENT_MEDIA_CHANGE : 0;
982} 984}
983 985
984static int floppy_revalidate(struct gendisk *disk) 986static int floppy_revalidate(struct gendisk *disk)
@@ -1025,7 +1027,7 @@ static const struct block_device_operations floppy_fops = {
1025 .open = floppy_unlocked_open, 1027 .open = floppy_unlocked_open,
1026 .release = floppy_release, 1028 .release = floppy_release,
1027 .ioctl = floppy_ioctl, 1029 .ioctl = floppy_ioctl,
1028 .media_changed = floppy_check_change, 1030 .check_events = floppy_check_events,
1029 .revalidate_disk= floppy_revalidate, 1031 .revalidate_disk= floppy_revalidate,
1030}; 1032};
1031 1033
@@ -1161,6 +1163,7 @@ static int __devinit swim3_attach(struct macio_dev *mdev, const struct of_device
1161 disk->major = FLOPPY_MAJOR; 1163 disk->major = FLOPPY_MAJOR;
1162 disk->first_minor = i; 1164 disk->first_minor = i;
1163 disk->fops = &floppy_fops; 1165 disk->fops = &floppy_fops;
1166 disk->events = DISK_EVENT_MEDIA_CHANGE;
1164 disk->private_data = &floppy_states[i]; 1167 disk->private_data = &floppy_states[i];
1165 disk->queue = swim3_queue; 1168 disk->queue = swim3_queue;
1166 disk->flags |= GENHD_FL_REMOVABLE; 1169 disk->flags |= GENHD_FL_REMOVABLE;