mmc: atmel-sdhci: fix the clk_enable call in case of no ops
Subsystems (2)
PATCH v2 1/1 mmc: atmel-sdhci: fix the clk_enable call in case of no ops
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.
---
Changes in v2:
- fixed issue with ret being 0, it was going to return ret;, when in fact there was no error. Have to check for both ret != 0 and ret != -ENOSYS.
drivers/mmc/atmel_sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/atmel_sdhci.c +2 -1
@@ -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 && ret != -ENOSYS )return ret; ret =mmc_of_parse (dev, &plat->cfg);
Signature · 1 line
2.25.1
PATCH v2 1/1 mmc: atmel-sdhci: fix the clk_enable call in case of no ops
Quoted 11 lines · Eugen Hristev
If the clock driver does not offer a
clk_enableops, then the system will return-ENOSYS.
Theclk_enableworks with CCF (common clock framework).
Some clocks in some cases (like the generic clock for some products: sama5d2) do not have theclk_enableprimitive, 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 theset_rateprimitives.
Quoted 2 lines
Fixes 81f16438d4 ("mmc: atmel-sdhci: enable the required generic clock")Signed-off-by Eugen Hristev <[email protected]>
Best Regards,
Jaehoon Chung
Quoted 24 lines
---
Changes in v2:
- fixed issue with ret being 0, it was going to return ret;, when in fact there was no error. Have to check for both ret != 0 and ret !=-ENOSYS.drivers/mmc/atmel_sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/mmc/atmel_sdhci.c +2
-1@@ -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 && ret != -ENOSYS )return ret; ret =mmc_of_parse (dev, &plat->cfg);
PATCH v2 1/1 mmc: atmel-sdhci: fix the clk_enable call in case of no ops
Quoted 12 lines · Jaehoon Chung
Quoted 11 lines · Eugen Hristev
If the clock driver does not offer a
clk_enableops, then the system will return-ENOSYS.
Theclk_enableworks with CCF (common clock framework).
Some clocks in some cases (like the generic clock for some products: sama5d2) do not have theclk_enableprimitive, 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 theset_rateprimitives.
Quoted 9 lines
Quoted 2 lines
Fixes 81f16438d4 ("mmc: atmel-sdhci: enable the required generic clock")Signed-off-by Eugen Hristev <[email protected]>Reviewed-by Jaehoon Chung <[email protected]>Best Regards,
Jaehoon ChungQuoted 1 line
---
Applied to u-boot-atmel/master