aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:45:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 13:45:01 -0500
commit275220f0fcff1adf28a717076e00f575edf05fda (patch)
treed249bccc80c64443dab211639050c4fb14332648 /drivers/scsi/scsi_lib.c
parentfe3c560b8a22cb28e54fe8950abef38e88d75831 (diff)
parent81c5e2ae33c4b19e53966b427e33646bf6811830 (diff)
Merge branch 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block
* 'for-2.6.38/core' of git://git.kernel.dk/linux-2.6-block: (43 commits) block: ensure that completion error gets properly traced blktrace: add missing probe argument to block_bio_complete block cfq: don't use atomic_t for cfq_group block cfq: don't use atomic_t for cfq_queue block: trace event block fix unassigned field block: add internal hd part table references block: fix accounting bug on cross partition merges kref: add kref_test_and_get bio-integrity: mark kintegrityd_wq highpri and CPU intensive block: make kblockd_workqueue smarter Revert "sd: implement sd_check_events()" block: Clean up exit_io_context() source code. Fix compile warnings due to missing removal of a 'ret' variable fs/block: type signature of major_to_index(int) to major_to_index(unsigned) block: convert !IS_ERR(p) && p to !IS_ERR_NOR_NULL(p) cfq-iosched: don't check cfqg in choose_service_tree() fs/splice: Pull buf->ops->confirm() from splice_from_pipe actors cdrom: export cdrom_check_events() sd: implement sd_check_events() sr: implement sr_check_events() ...
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 501f67bef719..9045c52abd25 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1977,8 +1977,7 @@ EXPORT_SYMBOL(scsi_mode_sense);
1977 * in. 1977 * in.
1978 * 1978 *
1979 * Returns zero if unsuccessful or an error if TUR failed. For 1979 * Returns zero if unsuccessful or an error if TUR failed. For
1980 * removable media, a return of NOT_READY or UNIT_ATTENTION is 1980 * removable media, UNIT_ATTENTION sets ->changed flag.
1981 * translated to success, with the ->changed flag updated.
1982 **/ 1981 **/
1983int 1982int
1984scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, 1983scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
@@ -2005,16 +2004,6 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
2005 } while (scsi_sense_valid(sshdr) && 2004 } while (scsi_sense_valid(sshdr) &&
2006 sshdr->sense_key == UNIT_ATTENTION && --retries); 2005 sshdr->sense_key == UNIT_ATTENTION && --retries);
2007 2006
2008 if (!sshdr)
2009 /* could not allocate sense buffer, so can't process it */
2010 return result;
2011
2012 if (sdev->removable && scsi_sense_valid(sshdr) &&
2013 (sshdr->sense_key == UNIT_ATTENTION ||
2014 sshdr->sense_key == NOT_READY)) {
2015 sdev->changed = 1;
2016 result = 0;
2017 }
2018 if (!sshdr_external) 2007 if (!sshdr_external)
2019 kfree(sshdr); 2008 kfree(sshdr);
2020 return result; 2009 return result;