Skip to contentSkip to conversation

ASoC: tegra20-ac97: Convert to devm_clk_get()

PATCH In review Mark Brown 4 participants 5 messages Jun 26, 2013 – Jun 27, 2013 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/2 ASoC: tegra20-ac97: Convert to devm_clk_get()

From: Mark Brown <[email protected]>

---
 sound/soc/tegra/tegra20_ac97.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/tegra/tegra20_ac97.c +1 -3
index 2f70ea7..d8c142d 100644
@@ -327,7 +327,7 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
 	}
 	dev_set_drvdata(&pdev->dev, ac97);
 
-	ac97->clk_ac97 = clk_get(&pdev->dev, NULL);
+	ac97->clk_ac97 = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(ac97->clk_ac97)) {
 		dev_err(&pdev->dev, "Can't retrieve ac97 clock\n");
 		ret = PTR_ERR(ac97->clk_ac97);
@@ -443,7 +443,6 @@ err_unregister_pcm:
 err_unregister_component:
 	snd_soc_unregister_component(&pdev->dev);
 err_clk_put:
-	clk_put(ac97->clk_ac97);
 err:
 	return ret;
 }
@@ -458,7 +457,6 @@ static int tegra20_ac97_platform_remove(struct platform_device *pdev)
 	tegra_asoc_utils_fini(&ac97->util_data);
 
 	clk_disable_unprepare(ac97->clk_ac97);
-	clk_put(ac97->clk_ac97);
 
 	return 0;
 }
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): 1372245608-15596-1-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 2/2 ASoC: tegra20-ac97: Convert to devm_ioremap_resource()

From: Mark Brown <[email protected]>

---
 sound/soc/tegra/tegra20_ac97.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
sound/soc/tegra/tegra20_ac97.c +4 -12
index d8c142d..9043626d 100644
@@ -341,18 +341,10 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
 		goto err_clk_put;
 	}
 
-	memregion = devm_request_mem_region(&pdev->dev, mem->start,
-					    resource_size(mem), DRV_NAME);
-	if (!memregion) {
-		dev_err(&pdev->dev, "Memory region already claimed\n");
-		ret = -EBUSY;
-		goto err_clk_put;
-	}
-
-	regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
-	if (!regs) {
-		dev_err(&pdev->dev, "ioremap failed\n");
-		ret = -ENOMEM;
+	regs = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(regs)) {
+		ret = PTR_ERR(regs);
+		dev_err(&pdev->dev, "ioremap failed: %d\n", ret);
 		goto err_clk_put;
 	}
 
Signature · 1 line
1.8.3.1

A message that is not in the archive (sent off-list or not yet received): 1372245608-15596-2-git-send-email-broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] ASoC: tegra20-ac97: Convert to devm_ioremap_resource()

Quoted 21 lines · Mark Brown

From: Mark Brown <[email protected]>

---
 sound/soc/tegra/tegra20_ac97.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
sound/soc/tegra/tegra20_ac97.c +0 -6
index d8c142d..9043626d 100644
@@ -341,18 +341,10 @@ static int tegra20_ac97_platform_probe(struct platform_device *pdev)
 		goto err_clk_put;
 	}
 
-	memregion = devm_request_mem_region(&pdev->dev, mem->start,
-					    resource_size(mem), DRV_NAME);
-	if (!memregion) {
-		dev_err(&pdev->dev, "Memory region already claimed\n");
-		ret = -EBUSY;
-		goto err_clk_put;

sound/soc/tegra/tegra20_ac97.c static int tegra20_ac97_platform_probe(struct platform_device *pdev) · line 347

Quoted 10 lines
sound/soc/tegra/tegra20_ac97.c +4 -6
-	}
-
-	regs = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
-	if (!regs) {
-		dev_err(&pdev->dev, "ioremap failed\n");
-		ret = -ENOMEM;
+	regs = devm_ioremap_resource(&pdev->dev, mem);
+	if (IS_ERR(regs)) {
+		ret = PTR_ERR(regs);
+		dev_err(&pdev->dev, "ioremap failed: %d\n", ret);

Can you please remove this error message as well, please? A message to the same effect is already output by devm_ioremap_resource(). Other than that, looks good:

author maintainer
#5 lore raw

Re: [PATCH 2/2] ASoC: tegra20-ac97: Convert to devm_ioremap_resource()

Quoted 3 lines · Thierry Reding

Can you please remove this error message as well, please? A message to the same effect is already output by devm_ioremap_resource(). Other than that, looks good:

Too late, send an incremental patch please.