X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fscsi%2Fscsi_debug.c;h=0e529f8171c4123c98253e5035ede1b79d9cb1cf;hb=77427f514f88143bfef41ba8c1e624bc45f42297;hp=322b5a41a36ff10046021f4e289eac7ddb630568;hpb=52c1da39534fb382c061de58b65f678ad74b59f5;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 322b5a41a36..0e529f8171c 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -48,10 +48,6 @@ #include -#ifndef LINUX_VERSION_CODE -#include -#endif - #include "scsi_logging.h" #include "scsi_debug.h" @@ -182,7 +178,7 @@ struct sdebug_queued_cmd { }; static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE]; -static Scsi_Host_Template sdebug_driver_template = { +static struct scsi_host_template sdebug_driver_template = { .proc_info = scsi_debug_proc_info, .name = "SCSI DEBUG", .info = scsi_debug_info, @@ -225,8 +221,6 @@ static struct bus_type pseudo_lld_bus; static struct device_driver sdebug_driverfs_driver = { .name = sdebug_proc_name, .bus = &pseudo_lld_bus, - .probe = sdebug_driver_probe, - .remove = sdebug_driver_remove, }; static const int check_condition_result = @@ -283,7 +277,7 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done) unsigned char *cmd = (unsigned char *) SCpnt->cmnd; int block, upper_blk, num, k; int errsts = 0; - int target = SCpnt->device->id; + int target = scmd_id(SCpnt); struct sdebug_dev_info * devip = NULL; int inj_recovered = 0; @@ -1008,8 +1002,7 @@ static void timer_intr_handler(unsigned long indx) static int scsi_debug_slave_alloc(struct scsi_device * sdp) { if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_alloc\n"); return 0; } @@ -1018,8 +1011,7 @@ static int scsi_debug_slave_configure(struct scsi_device * sdp) struct sdebug_dev_info * devip; if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_configure <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_configure\n"); if (sdp->host->max_cmd_len != SCSI_DEBUG_MAX_CMD_LEN) sdp->host->max_cmd_len = SCSI_DEBUG_MAX_CMD_LEN; devip = devInfoReg(sdp); @@ -1036,8 +1028,7 @@ static void scsi_debug_slave_destroy(struct scsi_device * sdp) (struct sdebug_dev_info *)sdp->hostdata; if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) - printk(KERN_INFO "scsi_debug: slave_destroy <%u %u %u %u>\n", - sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); + sdev_printk(KERN_INFO, sdp, "scsi_debug: slave_destroy\n"); if (devip) { /* make this slot avaliable for re-use */ devip->used = 0; @@ -1326,9 +1317,9 @@ static int schedule_resp(struct scsi_cmnd * cmnd, if (scsi_result) { struct scsi_device * sdp = cmnd->device; - printk(KERN_INFO "scsi_debug: <%u %u %u %u> " - "non-zero result=0x%x\n", sdp->host->host_no, - sdp->channel, sdp->id, sdp->lun, scsi_result); + sdev_printk(KERN_INFO, sdp, + "non-zero result=0x%x\n", + scsi_result); } } if (cmnd && devip) { @@ -1803,6 +1794,8 @@ static int pseudo_lld_bus_match(struct device *dev, static struct bus_type pseudo_lld_bus = { .name = "pseudo", .match = pseudo_lld_bus_match, + .probe = sdebug_driver_probe, + .remove = sdebug_driver_remove, }; static void sdebug_release_adapter(struct device * dev)