[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220825074008.33349-2-jinpu.wang@ionos.com>
Date: Thu, 25 Aug 2022 09:40:07 +0200
From: Jack Wang <jinpu.wang@...os.com>
To: ulf.hansson@...aro.org, linux-mmc@...r.kernel.org
Cc: Neil Armstrong <narmstrong@...libre.com>,
Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] mmc: meson-mx-sdhc: Fix error check for dma_map_sg
dma_map_sg return 0 on error, also change the type for dma_len
from int to unsigned int.
Cc: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Neil Armstrong <narmstrong@...libre.com>
Cc: Kevin Hilman <khilman@...libre.com>
Cc: Jerome Brunet <jbrunet@...libre.com>
Cc: Martin Blumenstingl <martin.blumenstingl@...glemail.com>
Cc: linux-mmc@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linux-amlogic@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org
Signed-off-by: Jack Wang <jinpu.wang@...os.com>
---
drivers/mmc/host/meson-mx-sdhc-mmc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c
index e92e63cb5641..da85c2f2acb8 100644
--- a/drivers/mmc/host/meson-mx-sdhc-mmc.c
+++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c
@@ -381,14 +381,14 @@ static void meson_mx_sdhc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
static int meson_mx_sdhc_map_dma(struct mmc_host *mmc, struct mmc_request *mrq)
{
struct mmc_data *data = mrq->data;
- int dma_len;
+ unsigned int dma_len;
if (!data)
return 0;
dma_len = dma_map_sg(mmc_dev(mmc), data->sg, data->sg_len,
mmc_get_dma_dir(data));
- if (dma_len <= 0) {
+ if (!dma_len) {
dev_err(mmc_dev(mmc), "dma_map_sg failed\n");
return -ENOMEM;
}
--
2.34.1
Powered by blists - more mailing lists