summaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_tcq.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-10-31 08:17:34 +0100
committerDavid S. Miller <davem@davemloft.net>2008-10-31 08:17:34 +0100
commita1744d3bee19d3b9cbfb825ab316a101b9c9f109 (patch)
treec0e2324c09beca0eb5782eb5abf241ea2b7a4a11 /include/scsi/scsi_tcq.h
parentpci: use pci_ioremap_bar() in drivers/net (diff)
parentxfrm: do not leak ESRCH to user space (diff)
downloadlinux-a1744d3bee19d3b9cbfb825ab316a101b9c9f109.tar.xz
linux-a1744d3bee19d3b9cbfb825ab316a101b9c9f109.zip
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/p54/p54common.c
Diffstat (limited to 'include/scsi/scsi_tcq.h')
-rw-r--r--include/scsi/scsi_tcq.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/scsi/scsi_tcq.h b/include/scsi/scsi_tcq.h
index cf4c219c0b5c..17231385cb37 100644
--- a/include/scsi/scsi_tcq.h
+++ b/include/scsi/scsi_tcq.h
@@ -140,8 +140,18 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag)
*/
static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth)
{
- shost->bqt = blk_init_tags(depth);
- return shost->bqt ? 0 : -ENOMEM;
+ /*
+ * If the shared tag map isn't already initialized, do it now.
+ * This saves callers from having to check ->bqt when setting up
+ * devices on the shared host (for libata)
+ */
+ if (!shost->bqt) {
+ shost->bqt = blk_init_tags(depth);
+ if (!shost->bqt)
+ return -ENOMEM;
+ }
+
+ return 0;
}
/**