summaryrefslogtreecommitdiff
path: root/drivers/memory/tegra/mc.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2021-06-02 18:32:55 +0200
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2021-06-03 21:49:41 +0200
commitc64738e949940bea2bb426b104b4de0aa42a8f48 (patch)
tree748cc2715c254787a03b14da69efe235ea9ad2ed /drivers/memory/tegra/mc.c
parent5c9016f0a8a3ba30c6593d2cb0d067164dd41846 (diff)
memory: tegra: Make per-SoC setup more generic
The current per-SoC setup code runs at a fairly arbitrary point during probe, thereby making it less flexible for other SoC generations. Move the call around slightly (after only the very basic, common setup that applies to all SoC generations has been performed), which will allow it to be used for other implementations. Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20210602163302.120041-6-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Diffstat (limited to 'drivers/memory/tegra/mc.c')
-rw-r--r--drivers/memory/tegra/mc.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index a3b7ba33b7f9..ea2142ba720a 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -784,6 +784,14 @@ static int tegra_mc_probe(struct platform_device *pdev)
return PTR_ERR(mc->clk);
}
+ mc->debugfs.root = debugfs_create_dir("mc", NULL);
+
+ if (mc->soc->ops && mc->soc->ops->probe) {
+ err = mc->soc->ops->probe(mc);
+ if (err < 0)
+ return err;
+ }
+
#ifdef CONFIG_ARCH_TEGRA_2x_SOC
if (mc->soc == &tegra20_mc_soc) {
isr = tegra20_mc_irq;
@@ -827,15 +835,6 @@ static int tegra_mc_probe(struct platform_device *pdev)
return err;
}
- mc->debugfs.root = debugfs_create_dir("mc", NULL);
-
- if (mc->soc->ops && mc->soc->ops->init) {
- err = mc->soc->ops->init(mc);
- if (err < 0)
- dev_err(&pdev->dev, "failed to initialize SoC driver: %d\n",
- err);
- }
-
err = tegra_mc_reset_setup(mc);
if (err < 0)
dev_err(&pdev->dev, "failed to register reset controller: %d\n",