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 | 507daea2276677785ba8096d90b9e8049632fc46 (patch) | |
tree | fcf9037340b293546f21420a1285a32659cba492 /drivers/block/DAC960.c | |
parent | b1b56b93f331bd61492fdb99e7986f7a528ca730 (diff) |
dac960: Convert to bdops->check_events()
Convert from ->media_changed() to ->check_events().
DAC960 media change notification seems to be one way (once set, never
cleared) and will generate spurious events when polled once the
condition triggers.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'drivers/block/DAC960.c')
-rw-r--r-- | drivers/block/DAC960.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 1f286ab461d3..79882104e431 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
@@ -140,13 +140,14 @@ static int DAC960_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
142 | 142 | ||
143 | static int DAC960_media_changed(struct gendisk *disk) | 143 | static unsigned int DAC960_check_events(struct gendisk *disk, |
144 | unsigned int clearing) | ||
144 | { | 145 | { |
145 | DAC960_Controller_T *p = disk->queue->queuedata; | 146 | DAC960_Controller_T *p = disk->queue->queuedata; |
146 | int drive_nr = (long)disk->private_data; | 147 | int drive_nr = (long)disk->private_data; |
147 | 148 | ||
148 | if (!p->LogicalDriveInitiallyAccessible[drive_nr]) | 149 | if (!p->LogicalDriveInitiallyAccessible[drive_nr]) |
149 | return 1; | 150 | return DISK_EVENT_MEDIA_CHANGE; |
150 | return 0; | 151 | return 0; |
151 | } | 152 | } |
152 | 153 | ||
@@ -163,7 +164,7 @@ static const struct block_device_operations DAC960_BlockDeviceOperations = { | |||
163 | .owner = THIS_MODULE, | 164 | .owner = THIS_MODULE, |
164 | .open = DAC960_open, | 165 | .open = DAC960_open, |
165 | .getgeo = DAC960_getgeo, | 166 | .getgeo = DAC960_getgeo, |
166 | .media_changed = DAC960_media_changed, | 167 | .check_events = DAC960_check_events, |
167 | .revalidate_disk = DAC960_revalidate_disk, | 168 | .revalidate_disk = DAC960_revalidate_disk, |
168 | }; | 169 | }; |
169 | 170 | ||
@@ -2546,6 +2547,7 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) | |||
2546 | disk->major = MajorNumber; | 2547 | disk->major = MajorNumber; |
2547 | disk->first_minor = n << DAC960_MaxPartitionsBits; | 2548 | disk->first_minor = n << DAC960_MaxPartitionsBits; |
2548 | disk->fops = &DAC960_BlockDeviceOperations; | 2549 | disk->fops = &DAC960_BlockDeviceOperations; |
2550 | disk->events = DISK_EVENT_MEDIA_CHANGE; | ||
2549 | } | 2551 | } |
2550 | /* | 2552 | /* |
2551 | Indicate the Block Device Registration completed successfully, | 2553 | Indicate the Block Device Registration completed successfully, |