Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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

[akpm@osdl.org: add MODULE_PARM_DESC]
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Alan Cox and committed by
Linus Torvalds
aaeab80b 2ee91f19

+6
+6
drivers/scsi/ide-scsi.c
··· 110 110 } idescsi_scsi_t; 111 111 112 112 static DEFINE_MUTEX(idescsi_ref_mutex); 113 + static int idescsi_nocd; /* Set by module param to skip cd */ 113 114 114 115 #define ide_scsi_g(disk) \ 115 116 container_of((disk)->private_data, struct ide_scsi_obj, driver) ··· 1128 1127 warned = 1; 1129 1128 } 1130 1129 1130 + if (idescsi_nocd && drive->media == ide_cdrom) 1131 + return -ENODEV; 1132 + 1131 1133 if (!strstr("ide-scsi", drive->driver_req) || 1132 1134 !drive->present || 1133 1135 drive->media == ide_disk || ··· 1191 1187 driver_unregister(&idescsi_driver.gen_driver); 1192 1188 } 1193 1189 1190 + module_param(idescsi_nocd, int, 0600); 1191 + MODULE_PARM_DESC(idescsi_nocd, "Disable handling of CD-ROMs so they may be driven by ide-cd"); 1194 1192 module_init(init_idescsi_module); 1195 1193 module_exit(exit_idescsi_module); 1196 1194 MODULE_LICENSE("GPL");