diff options
author | Borislav Petkov <petkovbb@googlemail.com> | 2008-07-23 13:56:02 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:56:02 -0400 |
commit | 570f89ea5f3ee93756dc2293b83bdfedb8d35348 (patch) | |
tree | 60fa058726e1900cd3066244b62183c98086a970 /drivers/ide/ide-cd_ioctl.c | |
parent | ac77ef8b03677c8ae8afe77bccc5f6a969193a79 (diff) |
ide-cd: convert to using the new atapi_flags
There should be no functionality change resulting from this patch.
[bart: IDE_FLAG_* -> IDE_AFLAG_*, dev_flags -> atapi_flags]
Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-cd_ioctl.c')
-rw-r--r-- | drivers/ide/ide-cd_ioctl.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/ide/ide-cd_ioctl.c b/drivers/ide/ide-cd_ioctl.c index 24d002addf73..085442a47418 100644 --- a/drivers/ide/ide-cd_ioctl.c +++ b/drivers/ide/ide-cd_ioctl.c | |||
@@ -27,10 +27,9 @@ int ide_cdrom_open_real(struct cdrom_device_info *cdi, int purpose) | |||
27 | void ide_cdrom_release_real(struct cdrom_device_info *cdi) | 27 | void ide_cdrom_release_real(struct cdrom_device_info *cdi) |
28 | { | 28 | { |
29 | ide_drive_t *drive = cdi->handle; | 29 | ide_drive_t *drive = cdi->handle; |
30 | struct cdrom_info *cd = drive->driver_data; | ||
31 | 30 | ||
32 | if (!cdi->use_count) | 31 | if (!cdi->use_count) |
33 | cd->cd_flags &= ~IDE_CD_FLAG_TOC_VALID; | 32 | drive->atapi_flags &= ~IDE_AFLAG_TOC_VALID; |
34 | } | 33 | } |
35 | 34 | ||
36 | /* | 35 | /* |
@@ -83,13 +82,12 @@ int ide_cdrom_check_media_change_real(struct cdrom_device_info *cdi, | |||
83 | int slot_nr) | 82 | int slot_nr) |
84 | { | 83 | { |
85 | ide_drive_t *drive = cdi->handle; | 84 | ide_drive_t *drive = cdi->handle; |
86 | struct cdrom_info *cd = drive->driver_data; | ||
87 | int retval; | 85 | int retval; |
88 | 86 | ||
89 | if (slot_nr == CDSL_CURRENT) { | 87 | if (slot_nr == CDSL_CURRENT) { |
90 | (void) cdrom_check_status(drive, NULL); | 88 | (void) cdrom_check_status(drive, NULL); |
91 | retval = (cd->cd_flags & IDE_CD_FLAG_MEDIA_CHANGED) ? 1 : 0; | 89 | retval = (drive->atapi_flags & IDE_AFLAG_MEDIA_CHANGED) ? 1 : 0; |
92 | cd->cd_flags &= ~IDE_CD_FLAG_MEDIA_CHANGED; | 90 | drive->atapi_flags &= ~IDE_AFLAG_MEDIA_CHANGED; |
93 | return retval; | 91 | return retval; |
94 | } else { | 92 | } else { |
95 | return -EINVAL; | 93 | return -EINVAL; |
@@ -107,11 +105,11 @@ int cdrom_eject(ide_drive_t *drive, int ejectflag, | |||
107 | char loej = 0x02; | 105 | char loej = 0x02; |
108 | unsigned char cmd[BLK_MAX_CDB]; | 106 | unsigned char cmd[BLK_MAX_CDB]; |
109 | 107 | ||
110 | if ((cd->cd_flags & IDE_CD_FLAG_NO_EJECT) && !ejectflag) | 108 | if ((drive->atapi_flags & IDE_AFLAG_NO_EJECT) && !ejectflag) |
111 | return -EDRIVE_CANT_DO_THIS; | 109 | return -EDRIVE_CANT_DO_THIS; |
112 | 110 | ||
113 | /* reload fails on some drives, if the tray is locked */ | 111 | /* reload fails on some drives, if the tray is locked */ |
114 | if ((cd->cd_flags & IDE_CD_FLAG_DOOR_LOCKED) && ejectflag) | 112 | if ((drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED) && ejectflag) |
115 | return 0; | 113 | return 0; |
116 | 114 | ||
117 | /* only tell drive to close tray if open, if it can do that */ | 115 | /* only tell drive to close tray if open, if it can do that */ |
@@ -131,7 +129,6 @@ static | |||
131 | int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, | 129 | int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, |
132 | struct request_sense *sense) | 130 | struct request_sense *sense) |
133 | { | 131 | { |
134 | struct cdrom_info *cd = drive->driver_data; | ||
135 | struct request_sense my_sense; | 132 | struct request_sense my_sense; |
136 | int stat; | 133 | int stat; |
137 | 134 | ||
@@ -139,7 +136,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, | |||
139 | sense = &my_sense; | 136 | sense = &my_sense; |
140 | 137 | ||
141 | /* If the drive cannot lock the door, just pretend. */ | 138 | /* If the drive cannot lock the door, just pretend. */ |
142 | if (cd->cd_flags & IDE_CD_FLAG_NO_DOORLOCK) { | 139 | if (drive->atapi_flags & IDE_AFLAG_NO_DOORLOCK) { |
143 | stat = 0; | 140 | stat = 0; |
144 | } else { | 141 | } else { |
145 | unsigned char cmd[BLK_MAX_CDB]; | 142 | unsigned char cmd[BLK_MAX_CDB]; |
@@ -160,7 +157,7 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, | |||
160 | (sense->asc == 0x24 || sense->asc == 0x20)) { | 157 | (sense->asc == 0x24 || sense->asc == 0x20)) { |
161 | printk(KERN_ERR "%s: door locking not supported\n", | 158 | printk(KERN_ERR "%s: door locking not supported\n", |
162 | drive->name); | 159 | drive->name); |
163 | cd->cd_flags |= IDE_CD_FLAG_NO_DOORLOCK; | 160 | drive->atapi_flags |= IDE_AFLAG_NO_DOORLOCK; |
164 | stat = 0; | 161 | stat = 0; |
165 | } | 162 | } |
166 | 163 | ||
@@ -170,9 +167,9 @@ int ide_cd_lockdoor(ide_drive_t *drive, int lockflag, | |||
170 | 167 | ||
171 | if (stat == 0) { | 168 | if (stat == 0) { |
172 | if (lockflag) | 169 | if (lockflag) |
173 | cd->cd_flags |= IDE_CD_FLAG_DOOR_LOCKED; | 170 | drive->atapi_flags |= IDE_AFLAG_DOOR_LOCKED; |
174 | else | 171 | else |
175 | cd->cd_flags &= ~IDE_CD_FLAG_DOOR_LOCKED; | 172 | drive->atapi_flags &= ~IDE_AFLAG_DOOR_LOCKED; |
176 | } | 173 | } |
177 | 174 | ||
178 | return stat; | 175 | return stat; |
@@ -250,7 +247,7 @@ int ide_cdrom_get_last_session(struct cdrom_device_info *cdi, | |||
250 | struct request_sense sense; | 247 | struct request_sense sense; |
251 | int ret; | 248 | int ret; |
252 | 249 | ||
253 | if ((info->cd_flags & IDE_CD_FLAG_TOC_VALID) == 0 || !info->toc) { | 250 | if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0 || !info->toc) { |
254 | ret = ide_cd_read_toc(drive, &sense); | 251 | ret = ide_cd_read_toc(drive, &sense); |
255 | if (ret) | 252 | if (ret) |
256 | return ret; | 253 | return ret; |
@@ -308,7 +305,7 @@ int ide_cdrom_reset(struct cdrom_device_info *cdi) | |||
308 | * A reset will unlock the door. If it was previously locked, | 305 | * A reset will unlock the door. If it was previously locked, |
309 | * lock it again. | 306 | * lock it again. |
310 | */ | 307 | */ |
311 | if (cd->cd_flags & IDE_CD_FLAG_DOOR_LOCKED) | 308 | if (drive->atapi_flags & IDE_AFLAG_DOOR_LOCKED) |
312 | (void)ide_cd_lockdoor(drive, 1, &sense); | 309 | (void)ide_cd_lockdoor(drive, 1, &sense); |
313 | 310 | ||
314 | return ret; | 311 | return ret; |
@@ -324,7 +321,7 @@ static int ide_cd_get_toc_entry(ide_drive_t *drive, int track, | |||
324 | /* | 321 | /* |
325 | * don't serve cached data, if the toc isn't valid | 322 | * don't serve cached data, if the toc isn't valid |
326 | */ | 323 | */ |
327 | if ((info->cd_flags & IDE_CD_FLAG_TOC_VALID) == 0) | 324 | if ((drive->atapi_flags & IDE_AFLAG_TOC_VALID) == 0) |
328 | return -EINVAL; | 325 | return -EINVAL; |
329 | 326 | ||
330 | /* Check validity of requested track number. */ | 327 | /* Check validity of requested track number. */ |