Commit aaeab80b authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds
Browse files

[PATCH] ide_scsi: allow it to be used for non CD only

Some people want to use ide_cd for CD-ROM but still dynamically load
ide-scsi for things like tape drives.  If you compile in the CD driver this
works out but if you want them modular you need an option to ensure that
whoever loads first the right things happen.

This replaces the original draft patch which leaked a scsi host reference

Signed-off-by: default avatarAlan Cox <>
Cc: Bartlomiej Zolnierkiewicz <>
Cc: Jens Axboe <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2ee91f19
......@@ -110,6 +110,7 @@ typedef struct ide_scsi_obj {
} idescsi_scsi_t;
static DEFINE_MUTEX(idescsi_ref_mutex);
static int idescsi_nocd; /* Set by module param to skip cd */
#define ide_scsi_g(disk) \
container_of((disk)->private_data, struct ide_scsi_obj, driver)
......@@ -1127,6 +1128,9 @@ static int ide_scsi_probe(ide_drive_t *drive)
warned = 1;
if (idescsi_nocd && drive->media == ide_cdrom)
return -ENODEV;
if (!strstr("ide-scsi", drive->driver_req) ||
!drive->present ||
drive->media == ide_disk ||
......@@ -1187,6 +1191,8 @@ static void __exit exit_idescsi_module(void)
module_param(idescsi_nocd, int, 0600);
MODULE_PARM_DESC(idescsi_nocd, "Disable handling of CD-ROMs so they may be driven by ide-cd");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment