Skip to content

Commit

Permalink
cdrom: support devices that have check_events but not media_changed
Browse files Browse the repository at this point in the history
Commit 93aae17 ("sr: implement
sr_check_events()") replaced the media_changed op with the
check_events op in drivers/scsi/sr.c

All users that check for the CDC_MEDIA_CHANGED capbility try both
the check_events op and the media_changed op, but register_cdrom()
was requiring media_changed.

This patch fixes the capability checking.

The cdrom_select_disc ioctl is also using the two operations, so
they should be required for CDC_SELECT_DISC too.

Signed-off-by: Simon Arlott <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Kay Sievers <[email protected]>
Tested-by: Chris Clayton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
nomis authored and Jens Axboe committed Feb 9, 2011
1 parent 02a8f01 commit b8cf0e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ int register_cdrom(struct cdrom_device_info *cdi)
}

ENSURE(drive_status, CDC_DRIVE_STATUS );
ENSURE(media_changed, CDC_MEDIA_CHANGED);
if (cdo->check_events == NULL && cdo->media_changed == NULL)
*change_capability = ~(CDC_MEDIA_CHANGED | CDC_SELECT_DISC);
ENSURE(tray_move, CDC_CLOSE_TRAY | CDC_OPEN_TRAY);
ENSURE(lock_door, CDC_LOCK);
ENSURE(select_speed, CDC_SELECT_SPEED);
Expand Down

0 comments on commit b8cf0e0

Please sign in to comment.