12345678910111213141516171819202122232425262728293031323334353637 |
- From 16724d6ea40a2c9315f5a0d81005dfa4d7a6da24 Mon Sep 17 00:00:00 2001
- From: Luca Weiss <[email protected]>
- Date: Fri, 20 Oct 2023 11:55:40 +0100
- Subject: [PATCH] nvmem: qfprom: Mark core clk as optional
- On some platforms like sc7280 on non-ChromeOS devices the core clock
- cannot be touched by Linux so we cannot provide it. Mark it as optional
- as accessing qfprom for reading works without it but we still prohibit
- writing if we cannot provide the clock.
- Signed-off-by: Luca Weiss <[email protected]>
- Reviewed-by: Douglas Anderson <[email protected]>
- Signed-off-by: Srinivas Kandagatla <[email protected]>
- Link: https://lore.kernel.org/r/[email protected]
- Signed-off-by: Greg Kroah-Hartman <[email protected]>
- ---
- drivers/nvmem/qfprom.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
- --- a/drivers/nvmem/qfprom.c
- +++ b/drivers/nvmem/qfprom.c
- @@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_
- if (IS_ERR(priv->vcc))
- return PTR_ERR(priv->vcc);
-
- - priv->secclk = devm_clk_get(dev, "core");
- + priv->secclk = devm_clk_get_optional(dev, "core");
- if (IS_ERR(priv->secclk))
- return dev_err_probe(dev, PTR_ERR(priv->secclk), "Error getting clock\n");
-
- - /* Only enable writing if we have SoC data. */
- - if (priv->soc_data)
- + /* Only enable writing if we have SoC data and a valid clock */
- + if (priv->soc_data && priv->secclk)
- econfig.reg_write = qfprom_reg_write;
- }
-
|