diff options
author | Tejun Heo <tj@kernel.org> | 2011-03-09 13:54:28 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-09 13:54:28 -0500 |
commit | b1b56b93f331bd61492fdb99e7986f7a528ca730 (patch) | |
tree | e3740806510666f11d62befd0d7d917be1bc573d /drivers/block/paride/pd.c | |
parent | 1c27030bd21e7e2c68ef5be9f28c63778cf4b27f (diff) |
paride: Convert to bdops->check_events()
Convert paride drivers from ->media_changed() to ->check_events().
pcd and pd buffer and clear events after reporting; however, pf
unconditionally reports MEDIA_CHANGE and will generate spurious events
when polled.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Tim Waugh <tim@cyberelk.net>
Diffstat (limited to 'drivers/block/paride/pd.c')
-rw-r--r-- | drivers/block/paride/pd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index c0ee1558b9bb..21dfdb776869 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -794,7 +794,7 @@ static int pd_release(struct gendisk *p, fmode_t mode) | |||
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | static int pd_check_media(struct gendisk *p) | 797 | static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) |
798 | { | 798 | { |
799 | struct pd_unit *disk = p->private_data; | 799 | struct pd_unit *disk = p->private_data; |
800 | int r; | 800 | int r; |
@@ -803,7 +803,7 @@ static int pd_check_media(struct gendisk *p) | |||
803 | pd_special_command(disk, pd_media_check); | 803 | pd_special_command(disk, pd_media_check); |
804 | r = disk->changed; | 804 | r = disk->changed; |
805 | disk->changed = 0; | 805 | disk->changed = 0; |
806 | return r; | 806 | return r ? DISK_EVENT_MEDIA_CHANGE : 0; |
807 | } | 807 | } |
808 | 808 | ||
809 | static int pd_revalidate(struct gendisk *p) | 809 | static int pd_revalidate(struct gendisk *p) |
@@ -822,7 +822,7 @@ static const struct block_device_operations pd_fops = { | |||
822 | .release = pd_release, | 822 | .release = pd_release, |
823 | .ioctl = pd_ioctl, | 823 | .ioctl = pd_ioctl, |
824 | .getgeo = pd_getgeo, | 824 | .getgeo = pd_getgeo, |
825 | .media_changed = pd_check_media, | 825 | .check_events = pd_check_events, |
826 | .revalidate_disk= pd_revalidate | 826 | .revalidate_disk= pd_revalidate |
827 | }; | 827 | }; |
828 | 828 | ||
@@ -837,6 +837,7 @@ static void pd_probe_drive(struct pd_unit *disk) | |||
837 | p->fops = &pd_fops; | 837 | p->fops = &pd_fops; |
838 | p->major = major; | 838 | p->major = major; |
839 | p->first_minor = (disk - pd) << PD_BITS; | 839 | p->first_minor = (disk - pd) << PD_BITS; |
840 | p->events = DISK_EVENT_MEDIA_CHANGE; | ||
840 | disk->gd = p; | 841 | disk->gd = p; |
841 | p->private_data = disk; | 842 | p->private_data = disk; |
842 | p->queue = pd_queue; | 843 | p->queue = pd_queue; |