aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-03-09 13:54:29 -0500
committerTejun Heo <tj@kernel.org>2011-03-09 13:54:29 -0500
commitcafb0bfca1a73efd6d8a4a6a6a716e6134b96c24 (patch)
treee96bb102b905e5856a4d2a46ca3a4deb4922a9af /drivers
parent3c0d206092f50be82523dba2b0e0a02de9e6aad3 (diff)
staging: Convert to bdops->check_events()
Convert two staging drivers - blkvsc_drv and cyasblkdev_block - from ->media_changed() to ->check_events(). The former always indicated media changed while the latter always indicated media not changed. Not sure what the drivers are trying to achieve but keep the original behavior. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Jens Axboe <axboe@kernel.dk> Cc: Kay Sievers <kay.sievers@vrfy.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/hv/blkvsc_drv.c11
-rw-r--r--drivers/staging/westbridge/astoria/block/cyasblkdev_block.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 4fb809485d9e..1ecd7e17f571 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -131,7 +131,8 @@ static void blkvsc_shutdown(struct device *device);
131 131
132static int blkvsc_open(struct block_device *bdev, fmode_t mode); 132static int blkvsc_open(struct block_device *bdev, fmode_t mode);
133static int blkvsc_release(struct gendisk *disk, fmode_t mode); 133static int blkvsc_release(struct gendisk *disk, fmode_t mode);
134static int blkvsc_media_changed(struct gendisk *gd); 134static unsigned int blkvsc_check_events(struct gendisk *gd,
135 unsigned int clearing);
135static int blkvsc_revalidate_disk(struct gendisk *gd); 136static int blkvsc_revalidate_disk(struct gendisk *gd);
136static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg); 137static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg);
137static int blkvsc_ioctl(struct block_device *bd, fmode_t mode, 138static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
@@ -162,7 +163,7 @@ static const struct block_device_operations block_ops = {
162 .owner = THIS_MODULE, 163 .owner = THIS_MODULE,
163 .open = blkvsc_open, 164 .open = blkvsc_open,
164 .release = blkvsc_release, 165 .release = blkvsc_release,
165 .media_changed = blkvsc_media_changed, 166 .check_events = blkvsc_check_events,
166 .revalidate_disk = blkvsc_revalidate_disk, 167 .revalidate_disk = blkvsc_revalidate_disk,
167 .getgeo = blkvsc_getgeo, 168 .getgeo = blkvsc_getgeo,
168 .ioctl = blkvsc_ioctl, 169 .ioctl = blkvsc_ioctl,
@@ -367,6 +368,7 @@ static int blkvsc_probe(struct device *device)
367 else 368 else
368 blkdev->gd->first_minor = 0; 369 blkdev->gd->first_minor = 0;
369 blkdev->gd->fops = &block_ops; 370 blkdev->gd->fops = &block_ops;
371 blkdev->gd->events = DISK_EVENT_MEDIA_CHANGE;
370 blkdev->gd->private_data = blkdev; 372 blkdev->gd->private_data = blkdev;
371 blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device); 373 blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);
372 sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum); 374 sprintf(blkdev->gd->disk_name, "hd%c", 'a' + devnum);
@@ -1352,10 +1354,11 @@ static int blkvsc_release(struct gendisk *disk, fmode_t mode)
1352 return 0; 1354 return 0;
1353} 1355}
1354 1356
1355static int blkvsc_media_changed(struct gendisk *gd) 1357static unsigned int blkvsc_check_events(struct gendisk *gd,
1358 unsigned int clearing)
1356{ 1359{
1357 DPRINT_DBG(BLKVSC_DRV, "- enter\n"); 1360 DPRINT_DBG(BLKVSC_DRV, "- enter\n");
1358 return 1; 1361 return DISK_EVENT_MEDIA_CHANGE;
1359} 1362}
1360 1363
1361static int blkvsc_revalidate_disk(struct gendisk *gd) 1364static int blkvsc_revalidate_disk(struct gendisk *gd)
diff --git a/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c b/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
index e1851f00be56..842cd9214a5e 100644
--- a/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
+++ b/drivers/staging/westbridge/astoria/block/cyasblkdev_block.c
@@ -381,10 +381,10 @@ static int cyasblkdev_blk_ioctl(
381 return -ENOTTY; 381 return -ENOTTY;
382} 382}
383 383
384/* Media_changed block_device opp 384/* check_events block_device opp
385 * this one is called by kernel to confirm if the media really changed 385 * this one is called by kernel to confirm if the media really changed
386 * as we indicated by issuing check_disk_change() call */ 386 * as we indicated by issuing check_disk_change() call */
387int cyasblkdev_media_changed(struct gendisk *gd) 387unsigned int cyasblkdev_check_events(struct gendisk *gd, unsigned int clearing)
388{ 388{
389 struct cyasblkdev_blk_data *bd; 389 struct cyasblkdev_blk_data *bd;
390 390
@@ -402,7 +402,7 @@ int cyasblkdev_media_changed(struct gendisk *gd)
402 #endif 402 #endif
403 } 403 }
404 404
405 /* return media change state "1" yes, 0 no */ 405 /* return media change state - DISK_EVENT_MEDIA_CHANGE yes, 0 no */
406 return 0; 406 return 0;
407} 407}
408 408
@@ -432,7 +432,7 @@ static struct block_device_operations cyasblkdev_bdops = {
432 .ioctl = cyasblkdev_blk_ioctl, 432 .ioctl = cyasblkdev_blk_ioctl,
433 /* .getgeo = cyasblkdev_blk_getgeo, */ 433 /* .getgeo = cyasblkdev_blk_getgeo, */
434 /* added to support media removal( real and simulated) media */ 434 /* added to support media removal( real and simulated) media */
435 .media_changed = cyasblkdev_media_changed, 435 .check_events = cyasblkdev_check_events,
436 /* added to support media removal( real and simulated) media */ 436 /* added to support media removal( real and simulated) media */
437 .revalidate_disk = cyasblkdev_revalidate_disk, 437 .revalidate_disk = cyasblkdev_revalidate_disk,
438 .owner = THIS_MODULE, 438 .owner = THIS_MODULE,
@@ -1090,6 +1090,7 @@ static int cyasblkdev_add_disks(int bus_num,
1090 bd->user_disk_0->first_minor = devidx << CYASBLKDEV_SHIFT; 1090 bd->user_disk_0->first_minor = devidx << CYASBLKDEV_SHIFT;
1091 bd->user_disk_0->minors = 8; 1091 bd->user_disk_0->minors = 8;
1092 bd->user_disk_0->fops = &cyasblkdev_bdops; 1092 bd->user_disk_0->fops = &cyasblkdev_bdops;
1093 bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
1093 bd->user_disk_0->private_data = bd; 1094 bd->user_disk_0->private_data = bd;
1094 bd->user_disk_0->queue = bd->queue.queue; 1095 bd->user_disk_0->queue = bd->queue.queue;
1095 bd->dbgprn_flags = DBGPRN_RD_RQ; 1096 bd->dbgprn_flags = DBGPRN_RD_RQ;
@@ -1190,6 +1191,7 @@ static int cyasblkdev_add_disks(int bus_num,
1190 bd->user_disk_1->first_minor = (devidx + 1) << CYASBLKDEV_SHIFT; 1191 bd->user_disk_1->first_minor = (devidx + 1) << CYASBLKDEV_SHIFT;
1191 bd->user_disk_1->minors = 8; 1192 bd->user_disk_1->minors = 8;
1192 bd->user_disk_1->fops = &cyasblkdev_bdops; 1193 bd->user_disk_1->fops = &cyasblkdev_bdops;
1194 bd->user_disk_0->events = DISK_EVENT_MEDIA_CHANGE;
1193 bd->user_disk_1->private_data = bd; 1195 bd->user_disk_1->private_data = bd;
1194 bd->user_disk_1->queue = bd->queue.queue; 1196 bd->user_disk_1->queue = bd->queue.queue;
1195 bd->dbgprn_flags = DBGPRN_RD_RQ; 1197 bd->dbgprn_flags = DBGPRN_RD_RQ;
@@ -1278,6 +1280,7 @@ static int cyasblkdev_add_disks(int bus_num,
1278 (devidx + 2) << CYASBLKDEV_SHIFT; 1280 (devidx + 2) << CYASBLKDEV_SHIFT;
1279 bd->system_disk->minors = 8; 1281 bd->system_disk->minors = 8;
1280 bd->system_disk->fops = &cyasblkdev_bdops; 1282 bd->system_disk->fops = &cyasblkdev_bdops;
1283 bd->system_disk->events = DISK_EVENT_MEDIA_CHANGE;
1281 bd->system_disk->private_data = bd; 1284 bd->system_disk->private_data = bd;
1282 bd->system_disk->queue = bd->queue.queue; 1285 bd->system_disk->queue = bd->queue.queue;
1283 /* don't search for vfat 1286 /* don't search for vfat