[PATCH AUTOSEL 6.18-6.12] soc/tegra: fuse: Register nvmem lookups at probe

From: Sasha Levin

Date: Mon Aug 31 2026 - 10:17:13 EST


From: Kartik Rajput <kkartik@xxxxxxxxxx>

[ Upstream commit 8a3571618c2e3f339b5b6fee5841143face58a2b ]

Register nvmem lookups in tegra_fuse_probe(), after the nvmem device has
been registered, since they can only be used after the nvmem device is
registered.

Signed-off-by: Kartik Rajput <kkartik@xxxxxxxxxx>
Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---

LLM Generated explanations, may be completely bogus:

The background check on `stable/linux-6.18.y` finished and matches the
earlier analysis:

- **Prerequisites present:** `71661c1c8c34d` (lookup helper),
`972167c690801` (ACPI fuse support), `4a4193d9c6dde` (ACPI SoC
cleanup)
- **Fix not present:** no “Register nvmem lookups at probe” commit in
6.18.y

**Verdict for this tree (v6.18.44): YES** — small init-order fix for
ACPI Tegra fuse lookups; applies cleanly and corrects code already in
6.18.y.

drivers/soc/tegra/fuse/fuse-tegra.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index 74d2fedea71ca..972a63993e1db 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -182,10 +182,6 @@ static int tegra_fuse_probe(struct platform_device *pdev)
}

fuse->soc->init(fuse);
-
- err = tegra_fuse_add_lookups(fuse);
- if (err)
- return dev_err_probe(&pdev->dev, err, "failed to add FUSE lookups\n");
}

fuse->clk = devm_clk_get_optional(&pdev->dev, "fuse");
@@ -231,6 +227,10 @@ static int tegra_fuse_probe(struct platform_device *pdev)
return err;
}

+ err = tegra_fuse_add_lookups(fuse);
+ if (err)
+ return dev_err_probe(&pdev->dev, err, "failed to add FUSE lookups\n");
+
fuse->rst = devm_reset_control_get_optional(&pdev->dev, "fuse");
if (IS_ERR(fuse->rst))
return dev_err_probe(&pdev->dev, PTR_ERR(fuse->rst), "failed to get FUSE reset\n");
@@ -473,7 +473,7 @@ static int __init tegra_init_fuse(void)
const struct of_device_id *match;
struct device_node *np;
struct resource regs;
- int err;
+ int err = 0;

tegra_init_apbmisc();

@@ -566,10 +566,6 @@ static int __init tegra_init_fuse(void)

tegra_fuse_print_sku_info(&tegra_sku_info);

- err = tegra_fuse_add_lookups(fuse);
- if (err)
- pr_err("failed to add FUSE lookups\n");
-
return err;
}
early_initcall(tegra_init_fuse);
--
2.53.0