Skip to contentSkip to conversation

soc/tegra: fuse: Register nvmem lookups at probe

PATCH Applied Kartik Rajput 2 participants 2 messages May 14 – May 28 Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 soc/tegra: fuse: Register nvmem lookups at probe

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.

---
Changes in v2:
- Fix build warning reported by kernel test robot at
https://lore.kernel.org/oe-kbuild-all/[email protected]/

---
 drivers/soc/tegra/fuse/fuse-tegra.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/soc/tegra/fuse/fuse-tegra.c +5 -9
index f38107d04ed6..77a54124e9f4 100644
@@ -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");
@@ -478,7 +478,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();
 
@@ -571,10 +571,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);
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw

From: Thierry Reding <[email protected]>

Quoted 3 lines · Kartik Rajput

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.

Applied, thanks!

[1/1] soc/tegra: fuse: Register nvmem lookups at probe

      commit: a4fe834db418046525b749dbefcc790af9c92959

Best regards,

Signature · 1 line
Thierry Reding <[email protected]>