summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJack Wang <jinpu.wang@ionos.com>2022-08-25 10:40:07 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2022-09-14 12:53:47 +0300
commitf7865ad8b4003ec75faf4a69363a804851b68c7d (patch)
treef6d8eb82e5d780cfce418af826f4e9e3cf0629a3 /drivers/mmc
parent5cbedf52608cc3cbc1c2a9a861fb671620427a20 (diff)
downloadlinux-f7865ad8b4003ec75faf4a69363a804851b68c7d.tar.xz
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: Neil Armstrong <narmstrong@baylibre.com> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Jerome Brunet <jbrunet@baylibre.com> Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Jack Wang <jinpu.wang@ionos.com> Link: https://lore.kernel.org/r/20220825074008.33349-2-jinpu.wang@ionos.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/meson-mx-sdhc-mmc.c4
1 files 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;
}