* [PATCH] mtd: nand: mxc_nand: use clk_get_optional for clock handling
@ 2026-01-14 10:09 Alexander Shiyan
2026-01-16 8:18 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Shiyan @ 2026-01-14 10:09 UTC (permalink / raw)
To: barebox; +Cc: Alexander Shiyan
On some platforms like i.MX51, the clock driver does not support GATE clocks,
and the clocks are always on. The current driver uses clk_get which fails
when the clock is not found, preventing the driver from probing.
This patch changes clk_get to clk_get_optional, allowing the driver to
continue probing even if the clock is not provided, assuming it is always
enabled.
Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com>
---
drivers/mtd/nand/raw/mxc_nand.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index de2ad2a028..e328eb0815 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -1809,7 +1809,8 @@ static int mxcnd_probe(struct device *dev)
nand_set_controller_data(this, host);
nand_set_flash_node(this, dev->of_node);
- host->clk = clk_get(dev, NULL);
+ /* Clock support might not be implemented, so use the optional variant */
+ host->clk = clk_get_optional(dev, NULL);
if (IS_ERR(host->clk))
return PTR_ERR(host->clk);
--
2.52.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: nand: mxc_nand: use clk_get_optional for clock handling
2026-01-14 10:09 [PATCH] mtd: nand: mxc_nand: use clk_get_optional for clock handling Alexander Shiyan
@ 2026-01-16 8:18 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-01-16 8:18 UTC (permalink / raw)
To: barebox, Alexander Shiyan
On Wed, 14 Jan 2026 13:09:23 +0300, Alexander Shiyan wrote:
> On some platforms like i.MX51, the clock driver does not support GATE clocks,
> and the clocks are always on. The current driver uses clk_get which fails
> when the clock is not found, preventing the driver from probing.
>
> This patch changes clk_get to clk_get_optional, allowing the driver to
> continue probing even if the clock is not provided, assuming it is always
> enabled.
>
> [...]
Applied, thanks!
[1/1] mtd: nand: mxc_nand: use clk_get_optional for clock handling
https://git.pengutronix.de/cgit/barebox/commit/?id=092a3f95537b (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-16 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-14 10:09 [PATCH] mtd: nand: mxc_nand: use clk_get_optional for clock handling Alexander Shiyan
2026-01-16 8:18 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox