[PATCH v1 1/1] dmaengine: acpi-dma: truly print message when appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Even if we are not going to get a channel the message is issued. Check the
result of acpi_dma_request_slave_chan_by_index() before issuing the message.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/dma/acpi-dma.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c
index eed6bda..9927101 100644
--- a/drivers/dma/acpi-dma.c
+++ b/drivers/dma/acpi-dma.c
@@ -426,6 +426,7 @@ EXPORT_SYMBOL_GPL(acpi_dma_request_slave_chan_by_index);
 struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
 		const char *name)
 {
+	struct dma_chan *chan;
 	int index;
 
 	index = device_property_match_string(dev, "dma-names", name);
@@ -438,8 +439,12 @@ struct dma_chan *acpi_dma_request_slave_chan_by_name(struct device *dev,
 			return ERR_PTR(-ENODEV);
 	}
 
+	chan = acpi_dma_request_slave_chan_by_index(dev, index);
+	if (IS_ERR(chan))
+		return chan;
+
 	dev_dbg(dev, "found DMA channel \"%s\" at index %d\n", name, index);
-	return acpi_dma_request_slave_chan_by_index(dev, index);
+	return chan;
 }
 EXPORT_SYMBOL_GPL(acpi_dma_request_slave_chan_by_name);
 
-- 
2.7.0.rc3

--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux