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>
This commit is contained in:
parent
b1b56b93f3
commit
507daea227
1 changed files with 5 additions and 3 deletions
|
@ -140,13 +140,14 @@ static int DAC960_getgeo(struct block_device *bdev, struct hd_geometry *geo)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int DAC960_media_changed(struct gendisk *disk)
|
static unsigned int DAC960_check_events(struct gendisk *disk,
|
||||||
|
unsigned int clearing)
|
||||||
{
|
{
|
||||||
DAC960_Controller_T *p = disk->queue->queuedata;
|
DAC960_Controller_T *p = disk->queue->queuedata;
|
||||||
int drive_nr = (long)disk->private_data;
|
int drive_nr = (long)disk->private_data;
|
||||||
|
|
||||||
if (!p->LogicalDriveInitiallyAccessible[drive_nr])
|
if (!p->LogicalDriveInitiallyAccessible[drive_nr])
|
||||||
return 1;
|
return DISK_EVENT_MEDIA_CHANGE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +164,7 @@ static const struct block_device_operations DAC960_BlockDeviceOperations = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.open = DAC960_open,
|
.open = DAC960_open,
|
||||||
.getgeo = DAC960_getgeo,
|
.getgeo = DAC960_getgeo,
|
||||||
.media_changed = DAC960_media_changed,
|
.check_events = DAC960_check_events,
|
||||||
.revalidate_disk = DAC960_revalidate_disk,
|
.revalidate_disk = DAC960_revalidate_disk,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2546,6 +2547,7 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
|
||||||
disk->major = MajorNumber;
|
disk->major = MajorNumber;
|
||||||
disk->first_minor = n << DAC960_MaxPartitionsBits;
|
disk->first_minor = n << DAC960_MaxPartitionsBits;
|
||||||
disk->fops = &DAC960_BlockDeviceOperations;
|
disk->fops = &DAC960_BlockDeviceOperations;
|
||||||
|
disk->events = DISK_EVENT_MEDIA_CHANGE;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Indicate the Block Device Registration completed successfully,
|
Indicate the Block Device Registration completed successfully,
|
||||||
|
|
Loading…
Add table
Reference in a new issue