diff options
author | Tejun Heo <tj@kernel.org> | 2011-03-09 21:54:28 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-03-09 21:54:28 +0300 |
commit | b1b56b93f331bd61492fdb99e7986f7a528ca730 (patch) | |
tree | e3740806510666f11d62befd0d7d917be1bc573d /drivers/block/paride/pd.c | |
parent | 1c27030bd21e7e2c68ef5be9f28c63778cf4b27f (diff) | |
download | linux-b1b56b93f331bd61492fdb99e7986f7a528ca730.tar.xz |
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) return 0; } -static int pd_check_media(struct gendisk *p) +static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing) { struct pd_unit *disk = p->private_data; int r; @@ -803,7 +803,7 @@ static int pd_check_media(struct gendisk *p) pd_special_command(disk, pd_media_check); r = disk->changed; disk->changed = 0; - return r; + return r ? DISK_EVENT_MEDIA_CHANGE : 0; } static int pd_revalidate(struct gendisk *p) @@ -822,7 +822,7 @@ static const struct block_device_operations pd_fops = { .release = pd_release, .ioctl = pd_ioctl, .getgeo = pd_getgeo, - .media_changed = pd_check_media, + .check_events = pd_check_events, .revalidate_disk= pd_revalidate }; @@ -837,6 +837,7 @@ static void pd_probe_drive(struct pd_unit *disk) p->fops = &pd_fops; p->major = major; p->first_minor = (disk - pd) << PD_BITS; + p->events = DISK_EVENT_MEDIA_CHANGE; disk->gd = p; p->private_data = disk; p->queue = pd_queue; |