diff options
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a69b155f39a2..cb85296d5384 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -86,19 +86,6 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_DISK); | |||
86 | MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD); | 86 | MODULE_ALIAS_SCSI_DEVICE(TYPE_MOD); |
87 | MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC); | 87 | MODULE_ALIAS_SCSI_DEVICE(TYPE_RBC); |
88 | 88 | ||
89 | static int sd_revalidate_disk(struct gendisk *); | ||
90 | static int sd_probe(struct device *); | ||
91 | static int sd_remove(struct device *); | ||
92 | static void sd_shutdown(struct device *); | ||
93 | static int sd_suspend(struct device *, pm_message_t state); | ||
94 | static int sd_resume(struct device *); | ||
95 | static void sd_rescan(struct device *); | ||
96 | static int sd_done(struct scsi_cmnd *); | ||
97 | static void sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer); | ||
98 | static void scsi_disk_release(struct class_device *cdev); | ||
99 | static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); | ||
100 | static void sd_print_result(struct scsi_disk *, int); | ||
101 | |||
102 | static DEFINE_IDR(sd_index_idr); | 89 | static DEFINE_IDR(sd_index_idr); |
103 | static DEFINE_SPINLOCK(sd_index_lock); | 90 | static DEFINE_SPINLOCK(sd_index_lock); |
104 | 91 | ||
@@ -253,7 +240,6 @@ static struct scsi_driver sd_template = { | |||
253 | .shutdown = sd_shutdown, | 240 | .shutdown = sd_shutdown, |
254 | }, | 241 | }, |
255 | .rescan = sd_rescan, | 242 | .rescan = sd_rescan, |
256 | .done = sd_done, | ||
257 | }; | 243 | }; |
258 | 244 | ||
259 | /* | 245 | /* |
@@ -523,6 +509,12 @@ static int sd_prep_fn(struct request_queue *q, struct request *rq) | |||
523 | SCpnt->timeout_per_command = timeout; | 509 | SCpnt->timeout_per_command = timeout; |
524 | 510 | ||
525 | /* | 511 | /* |
512 | * This is the completion routine we use. This is matched in terms | ||
513 | * of capability to this function. | ||
514 | */ | ||
515 | SCpnt->done = sd_rw_intr; | ||
516 | |||
517 | /* | ||
526 | * This indicates that the command is ready from our end to be | 518 | * This indicates that the command is ready from our end to be |
527 | * queued. | 519 | * queued. |
528 | */ | 520 | */ |
@@ -895,13 +887,13 @@ static struct block_device_operations sd_fops = { | |||
895 | }; | 887 | }; |
896 | 888 | ||
897 | /** | 889 | /** |
898 | * sd_done - bottom half handler: called when the lower level | 890 | * sd_rw_intr - bottom half handler: called when the lower level |
899 | * driver has completed (successfully or otherwise) a scsi command. | 891 | * driver has completed (successfully or otherwise) a scsi command. |
900 | * @SCpnt: mid-level's per command structure. | 892 | * @SCpnt: mid-level's per command structure. |
901 | * | 893 | * |
902 | * Note: potentially run from within an ISR. Must not block. | 894 | * Note: potentially run from within an ISR. Must not block. |
903 | **/ | 895 | **/ |
904 | static int sd_done(struct scsi_cmnd *SCpnt) | 896 | static void sd_rw_intr(struct scsi_cmnd * SCpnt) |
905 | { | 897 | { |
906 | int result = SCpnt->result; | 898 | int result = SCpnt->result; |
907 | unsigned int xfer_size = SCpnt->request_bufflen; | 899 | unsigned int xfer_size = SCpnt->request_bufflen; |
@@ -922,7 +914,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
922 | SCSI_LOG_HLCOMPLETE(1, scsi_print_result(SCpnt)); | 914 | SCSI_LOG_HLCOMPLETE(1, scsi_print_result(SCpnt)); |
923 | if (sense_valid) { | 915 | if (sense_valid) { |
924 | SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt, | 916 | SCSI_LOG_HLCOMPLETE(1, scmd_printk(KERN_INFO, SCpnt, |
925 | "sd_done: sb[respc,sk,asc," | 917 | "sd_rw_intr: sb[respc,sk,asc," |
926 | "ascq]=%x,%x,%x,%x\n", | 918 | "ascq]=%x,%x,%x,%x\n", |
927 | sshdr.response_code, | 919 | sshdr.response_code, |
928 | sshdr.sense_key, sshdr.asc, | 920 | sshdr.sense_key, sshdr.asc, |
@@ -994,7 +986,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
994 | break; | 986 | break; |
995 | } | 987 | } |
996 | out: | 988 | out: |
997 | return good_bytes; | 989 | scsi_io_completion(SCpnt, good_bytes); |
998 | } | 990 | } |
999 | 991 | ||
1000 | static int media_not_present(struct scsi_disk *sdkp, | 992 | static int media_not_present(struct scsi_disk *sdkp, |