提交 deb81d80 编写于 作者: J James Bottomley 提交者: James Bottomley

[SCSI] add failure return to scsi_init_shared_tag_map()

And use it in the stex driver.
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 cf355883
...@@ -1108,9 +1108,8 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1108,9 +1108,8 @@ stex_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (err) if (err)
goto out_free_irq; goto out_free_irq;
scsi_init_shared_tag_map(host, ST_CAN_QUEUE); err = scsi_init_shared_tag_map(host, ST_CAN_QUEUE);
if (host->bqt == NULL) { if (err) {
err = -ENOMEM;
printk(KERN_ERR DRV_NAME "(%s): init shared queue failed\n", printk(KERN_ERR DRV_NAME "(%s): init shared queue failed\n",
pci_name(pdev)); pci_name(pdev));
goto out_free_irq; goto out_free_irq;
......
...@@ -138,9 +138,10 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) ...@@ -138,9 +138,10 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag)
* @shost: the host to share the tag map among all devices * @shost: the host to share the tag map among all devices
* @depth: the total depth of the map * @depth: the total depth of the map
*/ */
static inline void scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth)
{ {
shost->bqt = blk_init_tags(depth); shost->bqt = blk_init_tags(depth);
return shost->bqt ? 0 : -ENOMEM;
} }
#endif /* _SCSI_SCSI_TCQ_H */ #endif /* _SCSI_SCSI_TCQ_H */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册