Skip to content

Commit

Permalink
nvmem: qfprom: Mark core clk as optional
Browse files Browse the repository at this point in the history
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 <luca.weiss@fairphone.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20231020105545.216052-2-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Luca Weiss authored and Greg Kroah-Hartman committed Oct 21, 2023
1 parent 2399cde commit 16724d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/nvmem/qfprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ static int qfprom_probe(struct platform_device *pdev)
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;
}

Expand Down

0 comments on commit 16724d6

Please sign in to comment.