aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-12-06 23:39:33 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:43 -0500
commitaaeab80bdbc0d10a98adc6fa76c29ca2f1816553 (patch)
tree834f6a62ad9ba24da6aceeacacba93c3cc66b369 /drivers/scsi
parent2ee91f197c0bc654b24eed5831fd12aa0d566a7d (diff)
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ide-scsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 1427a41e8441..8f6b5bf580f6 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -110,6 +110,7 @@ typedef struct ide_scsi_obj {
110} idescsi_scsi_t; 110} idescsi_scsi_t;
111 111
112static DEFINE_MUTEX(idescsi_ref_mutex); 112static DEFINE_MUTEX(idescsi_ref_mutex);
113static int idescsi_nocd; /* Set by module param to skip cd */
113 114
114#define ide_scsi_g(disk) \ 115#define ide_scsi_g(disk) \
115 container_of((disk)->private_data, struct ide_scsi_obj, driver) 116 container_of((disk)->private_data, struct ide_scsi_obj, driver)
@@ -1127,6 +1128,9 @@ static int ide_scsi_probe(ide_drive_t *drive)
1127 warned = 1; 1128 warned = 1;
1128 } 1129 }
1129 1130
1131 if (idescsi_nocd && drive->media == ide_cdrom)
1132 return -ENODEV;
1133
1130 if (!strstr("ide-scsi", drive->driver_req) || 1134 if (!strstr("ide-scsi", drive->driver_req) ||
1131 !drive->present || 1135 !drive->present ||
1132 drive->media == ide_disk || 1136 drive->media == ide_disk ||
@@ -1187,6 +1191,8 @@ static void __exit exit_idescsi_module(void)
1187 driver_unregister(&idescsi_driver.gen_driver); 1191 driver_unregister(&idescsi_driver.gen_driver);
1188} 1192}
1189 1193
1194module_param(idescsi_nocd, int, 0600);
1195MODULE_PARM_DESC(idescsi_nocd, "Disable handling of CD-ROMs so they may be driven by ide-cd");
1190module_init(init_idescsi_module); 1196module_init(init_idescsi_module);
1191module_exit(exit_idescsi_module); 1197module_exit(exit_idescsi_module);
1192MODULE_LICENSE("GPL"); 1198MODULE_LICENSE("GPL");