From: Eugen Hristev <eugen.hristev@microchip.com>
To: u-boot@lists.denx.de
Subject: [PATCH] mmc: atmel-sdhci: fix the clk_enable call in case of no ops
Date: Tue, 3 Nov 2020 14:33:24 +0200 [thread overview]
Message-ID: <20201103123324.79741-1-eugen.hristev@microchip.com> (raw)
If the clock driver does not offer a clk_enable ops, then the system will
return -ENOSYS.
The clk_enable works with CCF (common clock framework).
Some clocks in some cases (like the generic clock for some products: sama5d2)
do not have the clk_enable primitive, and in this case probing of the driver
will fail.
This patch changes the behavior to return an error in case there is really
an error, and not a missing primitive.
If the clock driver does not have an enable primitive, most likely clocks
are always enabled or enabled in the set_rate primitives.
Fixes: 81f16438d4 ("mmc: atmel-sdhci: enable the required generic clock")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
drivers/mmc/atmel_sdhci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/atmel_sdhci.c b/drivers/mmc/atmel_sdhci.c
index f56ae63bc2..82dfc345c0 100644
--- a/drivers/mmc/atmel_sdhci.c
+++ b/drivers/mmc/atmel_sdhci.c
@@ -86,7 +86,8 @@ static int atmel_sdhci_probe(struct udevice *dev)
return -EINVAL;
ret = clk_enable(&clk);
- if (ret)
+ /* return error only if the clock really has a clock enable func */
+ if (ret != -ENOSYS)
return ret;
ret = mmc_of_parse(dev, &plat->cfg);
--
2.25.1
next reply other threads:[~2020-11-03 12:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201103123442epcas1p37504e94548c0b37a95311ab100c99106@epcas1p3.samsung.com>
2020-11-03 12:33 ` Eugen Hristev [this message]
2020-11-03 21:46 ` [PATCH] mmc: atmel-sdhci: fix the clk_enable call in case of no ops Jaehoon Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201103123324.79741-1-eugen.hristev@microchip.com \
--to=eugen.hristev@microchip.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox