mmc: bcm2835: Drop DMA channel error pointer check [Linux 5.1]

mmc: bcm2835: Drop DMA channel error pointer check [Linux 5.1]

This Linux kernel change "mmc: bcm2835: Drop DMA channel error pointer check" is included in the Linux 5.1 release. This change is authored by Lukas Wunner <lukas [at] wunner.de> on Sun Feb 3 09:27:00 2019 +0100. The commit for this change in Linux stable tree is e5c1e63 (patch).

mmc: bcm2835: Drop DMA channel error pointer check

bcm2835_add_host() invokes IS_ERR_OR_NULL() on a DMA channel pointer,
however dma_request_slave_channel() (which was used to populate the
pointer) never returns an error pointer.  So a NULL pointer check is
sufficient.

Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: Frank Pavlic <f.pavlic@kunbus.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/mmc/host/bcm2835.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index c9e7aa50..ab8d58a 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -1286,7 +1286,7 @@ static int bcm2835_add_host(struct bcm2835_host *host)
    spin_lock_init(&host->lock);
    mutex_init(&host->mutex);

-   if (IS_ERR_OR_NULL(host->dma_chan_rxtx)) {
+   if (!host->dma_chan_rxtx) {
        dev_warn(dev, "unable to initialise DMA channel. Falling back to PIO\n");
        host->use_dma = false;
    } else {

Leave a Reply

Your email address will not be published. Required fields are marked *