ide: add ide_set_media_lock() helper
* Set IDE_AFLAG_NO_DOORLOCK in idetape_get_mode_sense_result(), check it
in ide_tape_set_media_lock() and cleanup idetape_create_prevent_cmd().
* Set IDE_AFLAG_NO_DOORLOCK in ide_floppy_create_read_capacity_cmd() and
check it instead of IDE_AFLAG_CLIK_DRIVE in ide_floppy_set_media_lock().
* Add ide_set_media_lock() helper and convert ide-{floppy,tape}.c to use it.
* Remove no longer used ide*_create_prevent_cmd()/ide*_set_media_lock().
* Update comment in <linux/ide.h> accordingly.
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
@@ -317,10 +317,10 @@ struct ide_acpi_hwif_link;
|
||||
enum {
|
||||
IDE_AFLAG_DRQ_INTERRUPT = (1 << 0),
|
||||
IDE_AFLAG_MEDIA_CHANGED = (1 << 1),
|
||||
|
||||
/* ide-cd */
|
||||
/* Drive cannot lock the door. */
|
||||
IDE_AFLAG_NO_DOORLOCK = (1 << 2),
|
||||
|
||||
/* ide-cd */
|
||||
/* Drive cannot eject the disc. */
|
||||
IDE_AFLAG_NO_EJECT = (1 << 3),
|
||||
/* Drive is a pre ATAPI 1.2 drive. */
|
||||
@@ -1142,6 +1142,8 @@ void ide_queue_pc_head(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *,
|
||||
struct request *);
|
||||
int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *);
|
||||
|
||||
int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
|
||||
|
||||
ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
|
||||
ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
|
||||
void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
|
||||
|
||||
Reference in New Issue
Block a user