[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240930224919.355359-4-rosenp@gmail.com>
Date: Mon, 30 Sep 2024 15:49:19 -0700
From: Rosen Penev <rosenp@...il.com>
To: linux-mmc@...r.kernel.org
Cc: Chaotian Jing <chaotian.jing@...iatek.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-kernel@...r.kernel.org (open list:ARM/Mediatek SoC support),
linux-arm-kernel@...ts.infradead.org (moderated list:ARM/Mediatek SoC support),
linux-mediatek@...ts.infradead.org (moderated list:ARM/Mediatek SoC support)
Subject: [PATCH 3/3] mmc: mtk-sd: fix devm_clk_get_optional usage
This already returns NULL when not found. However, it can return
EPROBE_DEFER and should thus return here.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/mmc/host/mtk-sd.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 4be13b9c2d71..b02cbae96e89 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2769,9 +2769,8 @@ static int msdc_drv_probe(struct platform_device *pdev)
if (!(mmc->caps2 & MMC_CAP2_NO_MMC)) {
host->crypto_clk = devm_clk_get_optional(&pdev->dev, "crypto");
if (IS_ERR(host->crypto_clk))
- host->crypto_clk = NULL;
- else
- mmc->caps2 |= MMC_CAP2_CRYPTO;
+ return PTR_ERR(host->crypto_clk);
+ mmc->caps2 |= MMC_CAP2_CRYPTO;
}
host->irq = platform_get_irq(pdev, 0);
--
2.46.2
Powered by blists - more mailing lists