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/pf.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/pf.c')
-rw-r--r-- | drivers/block/paride/pf.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 635f25dd9e10..7adeb1edbf43 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -243,7 +243,8 @@ static struct pf_unit units[PF_UNITS]; static int pf_identify(struct pf_unit *pf); static void pf_lock(struct pf_unit *pf, int func); static void pf_eject(struct pf_unit *pf); -static int pf_check_media(struct gendisk *disk); +static unsigned int pf_check_events(struct gendisk *disk, + unsigned int clearing); static char pf_scratch[512]; /* scratch block buffer */ @@ -270,7 +271,7 @@ static const struct block_device_operations pf_fops = { .release = pf_release, .ioctl = pf_ioctl, .getgeo = pf_getgeo, - .media_changed = pf_check_media, + .check_events = pf_check_events, }; static void __init pf_init_units(void) @@ -293,6 +294,7 @@ static void __init pf_init_units(void) disk->first_minor = unit; strcpy(disk->disk_name, pf->name); disk->fops = &pf_fops; + disk->events = DISK_EVENT_MEDIA_CHANGE; if (!(*drives[unit])[D_PRT]) pf_drive_count++; } @@ -377,9 +379,9 @@ static int pf_release(struct gendisk *disk, fmode_t mode) } -static int pf_check_media(struct gendisk *disk) +static unsigned int pf_check_events(struct gendisk *disk, unsigned int clearing) { - return 1; + return DISK_EVENT_MEDIA_CHANGE; } static inline int status_reg(struct pf_unit *pf) |