Skip to contentSkip to conversation

ASoC: qcom: Minor code cleanups for lpass-cpu

PATCH Applied Stephen Boyd 4 participants 8 messages Jan 15, 2021 – Mar 1, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ASoC: qcom: Minor code cleanups for lpass-cpu

Here's some minor code cleanups for the lpass-cpu driver. I noticed that it casts away const from the driver data from DT. That's not great but fixing it is a little more involved. I'll get to it later. There's also some questionable clk_get() usage that should probably be clk_get_optional(). For now this should help a little.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>

Stephen Boyd (4):
ASoC: qcom: Remove useless debug print
ASoC: qcom: Add some names to regmap configs
ASoC: qcom: Stop casting away __iomem for error pointers
ASoC: qcom: Remove duplicate error messages on ioremap

 sound/soc/qcom/lpass-cpu.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

base-commit: 5c8fe583cce542aa0b84adc939ce85293de36e5e

Signature · 1 line
https://chromeos.dev
#1 lore raw

PATCH 1/4 ASoC: qcom: Remove useless debug print

This looks like a left over debug print that tells us that HDMI is enabled. Let's remove it as that's definitely not an error to have HDMI enabled.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>
Fixes 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver")
---
 sound/soc/qcom/lpass-cpu.c | 1 -
 1 file changed, 1 deletion(-)
sound/soc/qcom/lpass-cpu.c +0 -1
index af684fd19ab9..8437ba31a306 100644
@@ -742,7 +742,6 @@ static void of_lpass_cpu_parse_dai_data(struct device *dev,
 		}
 		if (id == LPASS_DP_RX) {
 			data->hdmi_port_enable = 1;
-			dev_err(dev, "HDMI Port is enabled: %d\n", id);
 		} else {
 			data->mi2s_playback_sd_mode[id] =
 				of_lpass_cpu_parse_sd_lines(dev, node,
Signature · 1 line
https://chromeos.dev
#2 lore raw

PATCH 2/4 ASoC: qcom: Add some names to regmap configs

In reply to Stephen Boyd

This device can sometimes have multiple regmaps. Let's add a name so that we can differentiate in debugfs more easily.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)
sound/soc/qcom/lpass-cpu.c +2 -0
index 8437ba31a306..40126202a4a3 100644
@@ -474,6 +474,7 @@ static bool lpass_cpu_regmap_volatile(struct device *dev, unsigned int reg)
 }
 
 static struct regmap_config lpass_cpu_regmap_config = {
+	.name = "lpass_cpu",
 	.reg_bits = 32,
 	.reg_stride = 4,
 	.val_bits = 32,
@@ -674,6 +675,7 @@ static bool lpass_hdmi_regmap_volatile(struct device *dev, unsigned int reg)
 }
 
 static struct regmap_config lpass_hdmi_regmap_config = {
+	.name = "lpass_hdmi",
 	.reg_bits = 32,
 	.reg_stride = 4,
 	.val_bits = 32,
Signature · 1 line
https://chromeos.dev
#3 lore raw

PATCH 3/4 ASoC: qcom: Stop casting away __iomem for error pointers

In reply to Stephen Boyd

We don't need to cast away __iomem when testing with IS_ERR() or converting with PTR_ERR(). Modern sparse can handle this just fine. Drop it.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>
---
 sound/soc/qcom/lpass-cpu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
sound/soc/qcom/lpass-cpu.c +6 -6
index 40126202a4a3..b267fe8db3fc 100644
@@ -788,10 +788,10 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-lpaif");
 
 	drvdata->lpaif = devm_ioremap_resource(dev, res);
-	if (IS_ERR((void const __force *)drvdata->lpaif)) {
+	if (IS_ERR(drvdata->lpaif)) {
 		dev_err(dev, "error mapping reg resource: %ld\n",
-				PTR_ERR((void const __force *)drvdata->lpaif));
-		return PTR_ERR((void const __force *)drvdata->lpaif);
+				PTR_ERR(drvdata->lpaif));
+		return PTR_ERR(drvdata->lpaif);
 	}
 
 	lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant,
@@ -810,10 +810,10 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-hdmiif");
 
 		drvdata->hdmiif = devm_ioremap_resource(dev, res);
-		if (IS_ERR((void const __force *)drvdata->hdmiif)) {
+		if (IS_ERR(drvdata->hdmiif)) {
 			dev_err(dev, "error mapping reg resource: %ld\n",
-					PTR_ERR((void const __force *)drvdata->hdmiif));
-			return PTR_ERR((void const __force *)drvdata->hdmiif);
+					PTR_ERR(drvdata->hdmiif));
+			return PTR_ERR(drvdata->hdmiif);
 		}
 
 		lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant,
Signature · 1 line
https://chromeos.dev
#4 lore raw

PATCH 4/4 ASoC: qcom: Remove duplicate error messages on ioremap

In reply to Stephen Boyd

We don't need to print an error message when these ioremap operations fail. The function that returns an error already prints an error message and properly attributes it to the device. Drop them to save some code.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>
---
 sound/soc/qcom/lpass-cpu.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
sound/soc/qcom/lpass-cpu.c +2 -8
index b267fe8db3fc..0ca957dcd3fe 100644
@@ -788,11 +788,8 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-lpaif");
 
 	drvdata->lpaif = devm_ioremap_resource(dev, res);
-	if (IS_ERR(drvdata->lpaif)) {
-		dev_err(dev, "error mapping reg resource: %ld\n",
-				PTR_ERR(drvdata->lpaif));
+	if (IS_ERR(drvdata->lpaif))
 		return PTR_ERR(drvdata->lpaif);
-	}
 
 	lpass_cpu_regmap_config.max_register = LPAIF_WRDMAPER_REG(variant,
 						variant->wrdma_channels +
@@ -810,11 +807,8 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
 		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "lpass-hdmiif");
 
 		drvdata->hdmiif = devm_ioremap_resource(dev, res);
-		if (IS_ERR(drvdata->hdmiif)) {
-			dev_err(dev, "error mapping reg resource: %ld\n",
-					PTR_ERR(drvdata->hdmiif));
+		if (IS_ERR(drvdata->hdmiif))
 			return PTR_ERR(drvdata->hdmiif);
-		}
 
 		lpass_hdmi_regmap_config.max_register = LPAIF_HDMI_RDMAPER_REG(variant,
 					variant->hdmi_rdma_channels);
Signature · 1 line
https://chromeos.dev
Reviewed-by on the v1 series
#5 lore raw
In reply to Stephen Boyd

Thanks Stephen for the cleanup patches.

All of them look good to me!

Quoted 11 lines · Stephen Boyd

Here's some minor code cleanups for the lpass-cpu driver. I noticed that it casts away const from the driver data from DT. That's not great but fixing it is a little more involved. I'll get to it later. There's also some questionable clk_get() usage that should probably be clk_get_optional(). For now this should help a little.

Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>
Quoted 9 lines

Stephen Boyd (4):
ASoC: qcom: Remove useless debug print
ASoC: qcom: Add some names to regmap configs
ASoC: qcom: Stop casting away __iomem for error pointers
ASoC: qcom: Remove duplicate error messages on ioremap

  sound/soc/qcom/lpass-cpu.c | 17 ++++++-----------
  1 file changed, 6 insertions(+), 11 deletions(-)
Quoted 1 line
maintainer
#6 lore raw
In reply to Stephen Boyd
Quoted 6 lines · Stephen Boyd

Here's some minor code cleanups for the lpass-cpu driver. I noticed that it casts away const from the driver data from DT. That's not great but fixing it is a little more involved. I'll get to it later. There's also some questionable clk_get() usage that should probably be clk_get_optional(). For now this should help a little.

Quoted 6 lines
Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ASoC: qcom: Remove useless debug print

      commit: 16117beb16f01a470d40339960ffae1e287c03be
[2/4] ASoC: qcom: Add some names to regmap configs
      commit: 03b49bf9a92b18bbfcc3b5eb206cca8447e9f2cb
[3/4] ASoC: qcom: Stop casting away __iomem for error pointers
      commit: e697df66876c182927899950971c3b4888df3e6e
[4/4] ASoC: qcom: Remove duplicate error messages on ioremap
      commit: 4e15f5060d34dd28591cf3af43d3086a4b76c965

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

#7 lore raw
In reply to Stephen Boyd
This series was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This series was applied to qcom/linux.git (refs/heads/for-next):

Quoted 6 lines · On Thu, 14 Jan 2021 19:43:23 -0800 you wrote:

Here's some minor code cleanups for the lpass-cpu driver. I noticed that it casts away const from the driver data from DT. That's not great but fixing it is a little more involved. I'll get to it later. There's also some questionable clk_get() usage that should probably be clk_get_optional(). For now this should help a little.

Quoted 6 lines
Cc V Sujith Kumar Reddy <[email protected]>
Cc Srinivasa Rao <[email protected]>
Cc Srinivas Kandagatla <[email protected]>
Cc Cheng-Yi Chiang <[email protected]>

[...]

Here is the summary with links:
- [1/4] ASoC: qcom: Remove useless debug print

    https://git.kernel.org/qcom/c/16117beb16f0
  - [2/4] ASoC: qcom: Add some names to regmap configs
    https://git.kernel.org/qcom/c/03b49bf9a92b
  - [3/4] ASoC: qcom: Stop casting away __iomem for error pointers
    https://git.kernel.org/qcom/c/e697df66876c
  - [4/4] ASoC: qcom: Remove duplicate error messages on ioremap
    https://git.kernel.org/qcom/c/4e15f5060d34

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html