From: Christoph Hellwig Date: Tue, 3 Sep 2019 08:46:12 +0000 (+0200) Subject: usb-storage: use hcd_uses_dma to check for DMA capabilities X-Git-Tag: v5.4-rc1~136^2~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bf89015a54131253f963ee68b95461e6a3a4c462;p=thirdparty%2Fkernel%2Flinux.git 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: Christoph Hellwig Link: https://lore.kernel.org/r/20190903084615.19161-4-hch@lst.de Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index df4de8323eff9..6737fab949594 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -40,6 +40,7 @@ #include #include "usb.h" +#include #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); /*