summaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-05-26 10:20:35 -0400
committerThierry Reding <treding@nvidia.com>2018-07-10 11:29:15 -0400
commit1662dd641f596e5517c7b7a23e4f8ddf36741b5f (patch)
tree2982198dbc9739b0bb87110e5cf10e3c8865ee07 /drivers/memory
parentce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff)
memory: tegra: Correct driver probe order
The Reset Controller should be registered in the end of probe, otherwise Memory Controller device goes away if IRQ requesting fails and the Reset Controller stays registered. To avoid having to unwind the MC probing in a case of SMMU probe failure, let's simply print the error message without failing the MC probe. This allows us to just move the Reset Controller registering before the SMMU registration, reducing code churning. Also let's not fail MC probe in a case of Reset Controller registration failure as it doesn't prevent the MC driver to work. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/tegra/mc.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c
index bb93cc53554e..bd25faf6d13d 100644
--- a/drivers/memory/tegra/mc.c
+++ b/drivers/memory/tegra/mc.c
@@ -672,13 +672,6 @@ static int tegra_mc_probe(struct platform_device *pdev)
672 return err; 672 return err;
673 } 673 }
674 674
675 err = tegra_mc_reset_setup(mc);
676 if (err < 0) {
677 dev_err(&pdev->dev, "failed to register reset controller: %d\n",
678 err);
679 return err;
680 }
681
682 mc->irq = platform_get_irq(pdev, 0); 675 mc->irq = platform_get_irq(pdev, 0);
683 if (mc->irq < 0) { 676 if (mc->irq < 0) {
684 dev_err(&pdev->dev, "interrupt not specified\n"); 677 dev_err(&pdev->dev, "interrupt not specified\n");
@@ -697,13 +690,16 @@ static int tegra_mc_probe(struct platform_device *pdev)
697 return err; 690 return err;
698 } 691 }
699 692
693 err = tegra_mc_reset_setup(mc);
694 if (err < 0)
695 dev_err(&pdev->dev, "failed to register reset controller: %d\n",
696 err);
697
700 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) { 698 if (IS_ENABLED(CONFIG_TEGRA_IOMMU_SMMU)) {
701 mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc); 699 mc->smmu = tegra_smmu_probe(&pdev->dev, mc->soc->smmu, mc);
702 if (IS_ERR(mc->smmu)) { 700 if (IS_ERR(mc->smmu))
703 dev_err(&pdev->dev, "failed to probe SMMU: %ld\n", 701 dev_err(&pdev->dev, "failed to probe SMMU: %ld\n",
704 PTR_ERR(mc->smmu)); 702 PTR_ERR(mc->smmu));
705 return PTR_ERR(mc->smmu);
706 }
707 } 703 }
708 704
709 return 0; 705 return 0;