Commit 0a728e0b authored by Nagarjuna Kristam's avatar Nagarjuna Kristam Committed by Thierry Reding

soc/tegra: fuse: Add FUSE clock check in tegra_fuse_readl()

tegra_fuse_readl() can be called from drivers at any time. If this API
is called before tegra_fuse_probe(), we end up enabling the clock before
it is registered. Add a check for the FUSE clock in tegra_fuse_readl()
and propagate any errors.
Signed-off-by: default avatarNagarjuna Kristam <nkristam@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 54ecb8f7
...@@ -186,9 +186,12 @@ u32 __init tegra_fuse_read_early(unsigned int offset) ...@@ -186,9 +186,12 @@ u32 __init tegra_fuse_read_early(unsigned int offset)
int tegra_fuse_readl(unsigned long offset, u32 *value) int tegra_fuse_readl(unsigned long offset, u32 *value)
{ {
if (!fuse->read) if (!fuse->read || !fuse->clk)
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (IS_ERR(fuse->clk))
return PTR_ERR(fuse->clk);
*value = fuse->read(fuse, offset); *value = fuse->read(fuse, offset);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment