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@gmail.com>
Link: https://lore.kernel.org/r/20240930224919.355359-4-rosenp@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Rosen Penev 2024-09-30 15:49:19 -07:00 committed by Ulf Hansson
parent 88ef1c6371
commit ed299eda8f

View File

@ -2794,9 +2794,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);