diff options
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r-- | drivers/block/pktcdvd.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 77d70eebb6b2..07a382eaf0a8 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -1606,8 +1606,6 @@ static int kcdrwd(void *foobar) | |||
1606 | min_sleep_time = pkt->sleep_time; | 1606 | min_sleep_time = pkt->sleep_time; |
1607 | } | 1607 | } |
1608 | 1608 | ||
1609 | generic_unplug_device(bdev_get_queue(pd->bdev)); | ||
1610 | |||
1611 | VPRINTK("kcdrwd: sleeping\n"); | 1609 | VPRINTK("kcdrwd: sleeping\n"); |
1612 | residue = schedule_timeout(min_sleep_time); | 1610 | residue = schedule_timeout(min_sleep_time); |
1613 | VPRINTK("kcdrwd: wake up\n"); | 1611 | VPRINTK("kcdrwd: wake up\n"); |
@@ -2796,7 +2794,8 @@ static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd, | |||
2796 | return ret; | 2794 | return ret; |
2797 | } | 2795 | } |
2798 | 2796 | ||
2799 | static int pkt_media_changed(struct gendisk *disk) | 2797 | static unsigned int pkt_check_events(struct gendisk *disk, |
2798 | unsigned int clearing) | ||
2800 | { | 2799 | { |
2801 | struct pktcdvd_device *pd = disk->private_data; | 2800 | struct pktcdvd_device *pd = disk->private_data; |
2802 | struct gendisk *attached_disk; | 2801 | struct gendisk *attached_disk; |
@@ -2806,9 +2805,9 @@ static int pkt_media_changed(struct gendisk *disk) | |||
2806 | if (!pd->bdev) | 2805 | if (!pd->bdev) |
2807 | return 0; | 2806 | return 0; |
2808 | attached_disk = pd->bdev->bd_disk; | 2807 | attached_disk = pd->bdev->bd_disk; |
2809 | if (!attached_disk) | 2808 | if (!attached_disk || !attached_disk->fops->check_events) |
2810 | return 0; | 2809 | return 0; |
2811 | return attached_disk->fops->media_changed(attached_disk); | 2810 | return attached_disk->fops->check_events(attached_disk, clearing); |
2812 | } | 2811 | } |
2813 | 2812 | ||
2814 | static const struct block_device_operations pktcdvd_ops = { | 2813 | static const struct block_device_operations pktcdvd_ops = { |
@@ -2816,7 +2815,7 @@ static const struct block_device_operations pktcdvd_ops = { | |||
2816 | .open = pkt_open, | 2815 | .open = pkt_open, |
2817 | .release = pkt_close, | 2816 | .release = pkt_close, |
2818 | .ioctl = pkt_ioctl, | 2817 | .ioctl = pkt_ioctl, |
2819 | .media_changed = pkt_media_changed, | 2818 | .check_events = pkt_check_events, |
2820 | }; | 2819 | }; |
2821 | 2820 | ||
2822 | static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) | 2821 | static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode) |
@@ -2889,6 +2888,10 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev) | |||
2889 | if (ret) | 2888 | if (ret) |
2890 | goto out_new_dev; | 2889 | goto out_new_dev; |
2891 | 2890 | ||
2891 | /* inherit events of the host device */ | ||
2892 | disk->events = pd->bdev->bd_disk->events; | ||
2893 | disk->async_events = pd->bdev->bd_disk->async_events; | ||
2894 | |||
2892 | add_disk(disk); | 2895 | add_disk(disk); |
2893 | 2896 | ||
2894 | pkt_sysfs_dev_new(pd); | 2897 | pkt_sysfs_dev_new(pd); |