diff options
Diffstat (limited to 'drivers/ide/ide-cd_ioctl.c')
-rw-r--r-- | drivers/ide/ide-cd_ioctl.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 766b3deeb23c..02caa7dd51c8 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c | |||
@@ -79,8 +79,14 @@ int ide_cdrom_drive_status(struct cdrom_device_info *cdi, int slot_nr) | |||
79 | return CDS_DRIVE_NOT_READY; | 79 | return CDS_DRIVE_NOT_READY; |
80 | } | 80 | } |
81 | 81 | ||
82 | int ide_cdrom_check_media_change_real(struct cdrom_device_info *cdi, | 82 | /* |
83 | int slot_nr) | 83 | * ide-cd always generates media changed event if media is missing, which |
84 | * makes it impossible to use for proper event reporting, so disk->events | ||
85 | * is cleared to 0 and the following function is used only to trigger | ||
86 | * revalidation and never propagated to userland. | ||
87 | */ | ||
88 | unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *cdi, | ||
89 | unsigned int clearing, int slot_nr) | ||
84 | { | 90 | { |
85 | ide_drive_t *drive = cdi->handle; | 91 | ide_drive_t *drive = cdi->handle; |
86 | int retval; | 92 | int retval; |
@@ -89,9 +95,9 @@ int ide_cdrom_check_media_change_real(struct cdrom_device_info *cdi, | |||
89 | (void) cdrom_check_status(drive, NULL); | 95 | (void) cdrom_check_status(drive, NULL); |
90 | retval = (drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED) ? 1 : 0; | 96 | retval = (drive->dev_flags & IDE_DFLAG_MEDIA_CHANGED) ? 1 : 0; |
91 | drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED; | 97 | drive->dev_flags &= ~IDE_DFLAG_MEDIA_CHANGED; |
92 | return retval; | 98 | return retval ? DISK_EVENT_MEDIA_CHANGE : 0; |
93 | } else { | 99 | } else { |
94 | return -EINVAL; | 100 | return 0; |
95 | } | 101 | } |
96 | } | 102 | } |
97 | 103 | ||