[PATCH v4 3/4] ASoC: tegra: Use dev_err_probe() for regmap init failures

Sheetal posted 4 patches 9 hours ago
[PATCH v4 3/4] ASoC: tegra: Use dev_err_probe() for regmap init failures
Posted by Sheetal 9 hours ago
Use dev_err_probe() for regmap init failures in Tegra audio driver
probe paths.

Signed-off-by: Sheetal <sheetal@nvidia.com>
---
 sound/soc/tegra/tegra186_asrc.c  | 7 +++----
 sound/soc/tegra/tegra186_dspk.c  | 7 +++----
 sound/soc/tegra/tegra210_adx.c   | 7 +++----
 sound/soc/tegra/tegra210_ahub.c  | 7 +++----
 sound/soc/tegra/tegra210_amx.c   | 7 +++----
 sound/soc/tegra/tegra210_dmic.c  | 7 +++----
 sound/soc/tegra/tegra210_i2s.c   | 7 +++----
 sound/soc/tegra/tegra210_mixer.c | 7 +++----
 sound/soc/tegra/tegra210_mvc.c   | 7 +++----
 sound/soc/tegra/tegra210_sfc.c   | 7 +++----
 10 files changed, 30 insertions(+), 40 deletions(-)

diff --git a/sound/soc/tegra/tegra186_asrc.c b/sound/soc/tegra/tegra186_asrc.c
index 98e911e2ed74..a2b3c4d5e6f7 100644
--- a/sound/soc/tegra/tegra186_asrc.c
+++ b/sound/soc/tegra/tegra186_asrc.c
@@ -989,10 +989,9 @@ static int tegra186_asrc_platform_probe(struct platform_device *pdev)
 
 	asrc->regmap = devm_regmap_init_mmio(dev, regs,
 					     &tegra186_asrc_regmap_config);
-	if (IS_ERR(asrc->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(asrc->regmap);
-	}
+	if (IS_ERR(asrc->regmap))
+		return dev_err_probe(dev, PTR_ERR(asrc->regmap),
+				     "regmap init failed\n");
 
 	asrc->soc_data = of_device_get_match_data(&pdev->dev);
 
diff --git a/sound/soc/tegra/tegra186_dspk.c b/sound/soc/tegra/tegra186_dspk.c
index 1aa94c98294a..b3c4d5e6f7a8 100644
--- a/sound/soc/tegra/tegra186_dspk.c
+++ b/sound/soc/tegra/tegra186_dspk.c
@@ -505,10 +505,9 @@ static int tegra186_dspk_platform_probe(struct platform_device *pdev)
 		return PTR_ERR(regs);
 
 	dspk->regmap = devm_regmap_init_mmio(dev, regs, &tegra186_dspk_regmap);
-	if (IS_ERR(dspk->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(dspk->regmap);
-	}
+	if (IS_ERR(dspk->regmap))
+		return dev_err_probe(dev, PTR_ERR(dspk->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(dspk->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c
index d7d075fd54b2..c4d5e6f7a8b9 100644
--- a/sound/soc/tegra/tegra210_adx.c
+++ b/sound/soc/tegra/tegra210_adx.c
@@ -697,10 +697,9 @@ static int tegra210_adx_platform_probe(struct platform_device *pdev)
 
 	adx->regmap = devm_regmap_init_mmio(dev, regs,
 					    soc_data->regmap_conf);
-	if (IS_ERR(adx->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(adx->regmap);
-	}
+	if (IS_ERR(adx->regmap))
+		return dev_err_probe(dev, PTR_ERR(adx->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(adx->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c
index 4626dd0a4d55..d5e6f7a8b9c0 100644
--- a/sound/soc/tegra/tegra210_ahub.c
+++ b/sound/soc/tegra/tegra210_ahub.c
@@ -2275,10 +2275,9 @@ static int tegra_ahub_probe(struct platform_device *pdev)
 
 	ahub->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
 					     ahub->soc_data->regmap_config);
-	if (IS_ERR(ahub->regmap)) {
-		dev_err(&pdev->dev, "regmap init failed\n");
-		return PTR_ERR(ahub->regmap);
-	}
+	if (IS_ERR(ahub->regmap))
+		return dev_err_probe(&pdev->dev, PTR_ERR(ahub->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(ahub->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c
index 1b7fb84a0f34..e6f7a8b9c0d1 100644
--- a/sound/soc/tegra/tegra210_amx.c
+++ b/sound/soc/tegra/tegra210_amx.c
@@ -745,10 +745,9 @@ static int tegra210_amx_platform_probe(struct platform_device *pdev)
 
 	amx->regmap = devm_regmap_init_mmio(dev, regs,
 					    amx->soc_data->regmap_conf);
-	if (IS_ERR(amx->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(amx->regmap);
-	}
+	if (IS_ERR(amx->regmap))
+		return dev_err_probe(dev, PTR_ERR(amx->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(amx->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_dmic.c b/sound/soc/tegra/tegra210_dmic.c
index 5a4bd5cef30a..f7a8b9c0d1e2 100644
--- a/sound/soc/tegra/tegra210_dmic.c
+++ b/sound/soc/tegra/tegra210_dmic.c
@@ -517,10 +517,9 @@ static int tegra210_dmic_probe(struct platform_device *pdev)
 
 	dmic->regmap = devm_regmap_init_mmio(dev, regs,
 					     &tegra210_dmic_regmap_config);
-	if (IS_ERR(dmic->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(dmic->regmap);
-	}
+	if (IS_ERR(dmic->regmap))
+		return dev_err_probe(dev, PTR_ERR(dmic->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(dmic->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c
index 7bf76c9b640f..a8b9c0d1e2f3 100644
--- a/sound/soc/tegra/tegra210_i2s.c
+++ b/sound/soc/tegra/tegra210_i2s.c
@@ -1093,10 +1093,9 @@ static int tegra210_i2s_probe(struct platform_device *pdev)
 
 	i2s->regmap = devm_regmap_init_mmio(dev, regs,
 					    i2s->soc_data->regmap_conf);
-	if (IS_ERR(i2s->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(i2s->regmap);
-	}
+	if (IS_ERR(i2s->regmap))
+		return dev_err_probe(dev, PTR_ERR(i2s->regmap),
+				     "regmap init failed\n");
 
 	tegra210_parse_client_convert(dev);
 
diff --git a/sound/soc/tegra/tegra210_mixer.c b/sound/soc/tegra/tegra210_mixer.c
index d9318aaaf32e..b9c0d1e2f3a4 100644
--- a/sound/soc/tegra/tegra210_mixer.c
+++ b/sound/soc/tegra/tegra210_mixer.c
@@ -814,10 +814,9 @@ static int tegra210_mixer_platform_probe(struct platform_device *pdev)
 
 	mixer->regmap = devm_regmap_init_mmio(dev, regs,
 					      &tegra210_mixer_regmap_config);
-	if (IS_ERR(mixer->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(mixer->regmap);
-	}
+	if (IS_ERR(mixer->regmap))
+		return dev_err_probe(dev, PTR_ERR(mixer->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(mixer->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c
index 11bd0ea22797..c0d1e2f3a4b5 100644
--- a/sound/soc/tegra/tegra210_mvc.c
+++ b/sound/soc/tegra/tegra210_mvc.c
@@ -731,10 +731,9 @@ static int tegra210_mvc_platform_probe(struct platform_device *pdev)
 
 	mvc->regmap = devm_regmap_init_mmio(dev, regs,
 					    &tegra210_mvc_regmap_config);
-	if (IS_ERR(mvc->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(mvc->regmap);
-	}
+	if (IS_ERR(mvc->regmap))
+		return dev_err_probe(dev, PTR_ERR(mvc->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(mvc->regmap, true);
 
diff --git a/sound/soc/tegra/tegra210_sfc.c b/sound/soc/tegra/tegra210_sfc.c
index 0f342fae058f..d1e2f3a4b5c6 100644
--- a/sound/soc/tegra/tegra210_sfc.c
+++ b/sound/soc/tegra/tegra210_sfc.c
@@ -3598,10 +3598,9 @@ static int tegra210_sfc_platform_probe(struct platform_device *pdev)
 
 	sfc->regmap = devm_regmap_init_mmio(dev, regs,
 					    &tegra210_sfc_regmap_config);
-	if (IS_ERR(sfc->regmap)) {
-		dev_err(dev, "regmap init failed\n");
-		return PTR_ERR(sfc->regmap);
-	}
+	if (IS_ERR(sfc->regmap))
+		return dev_err_probe(dev, PTR_ERR(sfc->regmap),
+				     "regmap init failed\n");
 
 	regcache_cache_only(sfc->regmap, true);
 
-- 
2.17.1