提交 bf89015a 编写于 作者: C Christoph Hellwig 提交者: Greg Kroah-Hartman

usb-storage: use hcd_uses_dma to check for DMA capabilities

The dma_mask on its own doesn't mean much.  Instead check for the actual
flag.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20190903084615.19161-4-hch@lst.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8838d922
......@@ -40,6 +40,7 @@
#include <scsi/scsi_eh.h>
#include "usb.h"
#include <linux/usb/hcd.h>
#include "scsiglue.h"
#include "debug.h"
#include "transport.h"
......@@ -141,11 +142,10 @@ static int slave_configure(struct scsi_device *sdev)
/*
* Some USB host controllers can't do DMA; they have to use PIO.
* They indicate this by setting their dma_mask to NULL. For
* such controllers we need to make sure the block layer sets
* For such controllers we need to make sure the block layer sets
* up bounce buffers in addressable memory.
*/
if (!us->pusb_dev->bus->controller->dma_mask)
if (!hcd_uses_dma(bus_to_hcd(us->pusb_dev->bus)))
blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_HIGH);
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册