linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu
@ 2021-01-15  3:43 Stephen Boyd
  2021-01-15  3:43 ` [PATCH 1/4] ASoC: qcom: Remove useless debug print Stephen Boyd
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Stephen Boyd @ 2021-01-15  3:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Srinivas Kandagatla, Cheng-Yi Chiang

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 <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>

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
-- 
https://chromeos.dev


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/4] ASoC: qcom: Remove useless debug print
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
@ 2021-01-15  3:43 ` Stephen Boyd
  2021-01-15  3:43 ` [PATCH 2/4] ASoC: qcom: Add some names to regmap configs Stephen Boyd
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2021-01-15  3:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Srinivas Kandagatla, Cheng-Yi Chiang

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 <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Fixes: 7cb37b7bd0d3 ("ASoC: qcom: Add support for lpass hdmi driver")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 sound/soc/qcom/lpass-cpu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index af684fd19ab9..8437ba31a306 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -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,
-- 
https://chromeos.dev


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/4] ASoC: qcom: Add some names to regmap configs
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
  2021-01-15  3:43 ` [PATCH 1/4] ASoC: qcom: Remove useless debug print Stephen Boyd
@ 2021-01-15  3:43 ` Stephen Boyd
  2021-01-15  3:43 ` [PATCH 3/4] ASoC: qcom: Stop casting away __iomem for error pointers Stephen Boyd
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2021-01-15  3:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Srinivas Kandagatla, Cheng-Yi Chiang

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 <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 sound/soc/qcom/lpass-cpu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 8437ba31a306..40126202a4a3 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -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,
-- 
https://chromeos.dev


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/4] ASoC: qcom: Stop casting away __iomem for error pointers
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
  2021-01-15  3:43 ` [PATCH 1/4] ASoC: qcom: Remove useless debug print Stephen Boyd
  2021-01-15  3:43 ` [PATCH 2/4] ASoC: qcom: Add some names to regmap configs Stephen Boyd
@ 2021-01-15  3:43 ` Stephen Boyd
  2021-01-15  3:43 ` [PATCH 4/4] ASoC: qcom: Remove duplicate error messages on ioremap Stephen Boyd
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2021-01-15  3:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Srinivas Kandagatla, Cheng-Yi Chiang

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 <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 sound/soc/qcom/lpass-cpu.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index 40126202a4a3..b267fe8db3fc 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -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,
-- 
https://chromeos.dev


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/4] ASoC: qcom: Remove duplicate error messages on ioremap
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
                   ` (2 preceding siblings ...)
  2021-01-15  3:43 ` [PATCH 3/4] ASoC: qcom: Stop casting away __iomem for error pointers Stephen Boyd
@ 2021-01-15  3:43 ` Stephen Boyd
  2021-01-15 11:12 ` [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Srinivas Kandagatla
  2021-01-15 18:18 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Stephen Boyd @ 2021-01-15  3:43 UTC (permalink / raw)
  To: Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Srinivas Kandagatla, Cheng-Yi Chiang

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 <vsujithk@codeaurora.org>
Cc: Srinivasa Rao <srivasam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Cheng-Yi Chiang <cychiang@chromium.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 sound/soc/qcom/lpass-cpu.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
index b267fe8db3fc..0ca957dcd3fe 100644
--- a/sound/soc/qcom/lpass-cpu.c
+++ b/sound/soc/qcom/lpass-cpu.c
@@ -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);
-- 
https://chromeos.dev


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
                   ` (3 preceding siblings ...)
  2021-01-15  3:43 ` [PATCH 4/4] ASoC: qcom: Remove duplicate error messages on ioremap Stephen Boyd
@ 2021-01-15 11:12 ` Srinivas Kandagatla
  2021-01-15 18:18 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Srinivas Kandagatla @ 2021-01-15 11:12 UTC (permalink / raw)
  To: Stephen Boyd, Mark Brown
  Cc: linux-kernel, Liam Girdwood, Banajit Goswami, linux-arm-msm,
	Patrick Lai, alsa-devel, V Sujith Kumar Reddy, Srinivasa Rao,
	Cheng-Yi Chiang

Thanks Stephen for the cleanup patches.

All of them look good to me!

On 15/01/2021 03:43, Stephen Boyd 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.
> 
> Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
> Cc: Srinivasa Rao <srivasam@codeaurora.org>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Cheng-Yi Chiang <cychiang@chromium.org>
> 
> 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(-)
> 


Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu
  2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
                   ` (4 preceding siblings ...)
  2021-01-15 11:12 ` [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Srinivas Kandagatla
@ 2021-01-15 18:18 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2021-01-15 18:18 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Cheng-Yi Chiang, Patrick Lai, Banajit Goswami, Liam Girdwood,
	linux-arm-msm, Srinivas Kandagatla, alsa-devel, linux-kernel,
	V Sujith Kumar Reddy, Srinivasa Rao

On Thu, 14 Jan 2021 19:43:23 -0800, Stephen Boyd 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.
> 
> Cc: V Sujith Kumar Reddy <vsujithk@codeaurora.org>
> Cc: Srinivasa Rao <srivasam@codeaurora.org>
> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> Cc: Cheng-Yi Chiang <cychiang@chromium.org>
> 
> [...]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-15 18:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15  3:43 [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Stephen Boyd
2021-01-15  3:43 ` [PATCH 1/4] ASoC: qcom: Remove useless debug print Stephen Boyd
2021-01-15  3:43 ` [PATCH 2/4] ASoC: qcom: Add some names to regmap configs Stephen Boyd
2021-01-15  3:43 ` [PATCH 3/4] ASoC: qcom: Stop casting away __iomem for error pointers Stephen Boyd
2021-01-15  3:43 ` [PATCH 4/4] ASoC: qcom: Remove duplicate error messages on ioremap Stephen Boyd
2021-01-15 11:12 ` [PATCH 0/4] ASoC: qcom: Minor code cleanups for lpass-cpu Srinivas Kandagatla
2021-01-15 18:18 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).