diff options
author | Alexander Lobakin <alobakin@pm.me> | 2020-12-22 18:07:43 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2020-12-26 06:58:42 +0300 |
commit | 99e629f14b471d852d28ecf554093c4730ed0927 (patch) | |
tree | 633a479b49b1e29e11256076fea907afcbada034 | |
parent | 275e88b06a277ccf89d9c471a777e9b4f8c552b0 (diff) | |
download | linux-99e629f14b471d852d28ecf554093c4730ed0927.tar.xz |
PCI: dwc: Fix inverted condition of DMA mask setup warning
Commit 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address
allocation") added dma_mask_set() call to explicitly set 32-bit DMA mask
for MSI message mapping, but for now it throws a warning on ret == 0, while
dma_set_mask() returns 0 in case of success.
Fix this by inverting the condition.
[bhelgaas: join string to make it greppable]
Fixes: 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address allocation")
Link: https://lore.kernel.org/r/20201222150708.67983-1-alobakin@pm.me
Signed-off-by: Alexander Lobakin <alobakin@pm.me>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | drivers/pci/controller/dwc/pcie-designware-host.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 516b151e0ef3..8a84c005f32b 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -397,12 +397,8 @@ int dw_pcie_host_init(struct pcie_port *pp) pp); ret = dma_set_mask(pci->dev, DMA_BIT_MASK(32)); - if (!ret) { - dev_warn(pci->dev, - "Failed to set DMA mask to 32-bit. " - "Devices with only 32-bit MSI support" - " may not work properly\n"); - } + if (ret) + dev_warn(pci->dev, "Failed to set DMA mask to 32-bit. Devices with only 32-bit MSI support may not work properly\n"); pp->msi_data = dma_map_single_attrs(pci->dev, &pp->msi_msg, sizeof(pp->msi_msg), |