Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242270
b: refs/heads/master
c: 3c0d206
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed Mar 9, 2011
1 parent cfe8aa7 commit 5bf7c7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6fac80e3aa9e5bfc6cadb9ea8d0584c557c4b198
refs/heads/master: 3c0d206092f50be82523dba2b0e0a02de9e6aad3
13 changes: 9 additions & 4 deletions trunk/drivers/block/pktcdvd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2796,7 +2796,8 @@ static int pkt_ioctl(struct block_device *bdev, fmode_t mode, unsigned int cmd,
return ret;
}

static int pkt_media_changed(struct gendisk *disk)
static unsigned int pkt_check_events(struct gendisk *disk,
unsigned int clearing)
{
struct pktcdvd_device *pd = disk->private_data;
struct gendisk *attached_disk;
Expand All @@ -2806,17 +2807,17 @@ static int pkt_media_changed(struct gendisk *disk)
if (!pd->bdev)
return 0;
attached_disk = pd->bdev->bd_disk;
if (!attached_disk)
if (!attached_disk || !attached_disk->fops->check_events)
return 0;
return attached_disk->fops->media_changed(attached_disk);
return attached_disk->fops->check_events(attached_disk, clearing);
}

static const struct block_device_operations pktcdvd_ops = {
.owner = THIS_MODULE,
.open = pkt_open,
.release = pkt_close,
.ioctl = pkt_ioctl,
.media_changed = pkt_media_changed,
.check_events = pkt_check_events,
};

static char *pktcdvd_devnode(struct gendisk *gd, mode_t *mode)
Expand Down Expand Up @@ -2889,6 +2890,10 @@ static int pkt_setup_dev(dev_t dev, dev_t* pkt_dev)
if (ret)
goto out_new_dev;

/* inherit events of the host device */
disk->events = pd->bdev->bd_disk->events;
disk->async_events = pd->bdev->bd_disk->async_events;

add_disk(disk);

pkt_sysfs_dev_new(pd);
Expand Down

0 comments on commit 5bf7c7e

Please sign in to comment.