linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new()
@ 2023-10-13 22:19 Uwe Kleine-König
  2023-10-13 22:19 ` [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void Uwe Kleine-König
  2023-10-24 13:54 ` [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2023-10-13 22:19 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, Heiko Stuebner,
	linux-rockchip, alsa-devel, linux-arm-kernel, kernel,
	James Schulman, David Rhodes, Richard Fitzgerald, patches,
	Hal Feng, Xingyu Wu, Thierry Reding, Jonathan Hunter,
	Kuninori Morimoto, Rob Herring, AngeloGioacchino Del Regno,
	Wang Yufen, Aidan MacDonald, Jernej Skrabec, Claudiu Beznea,
	Astrid Rost, Robert Hancock, Herve Codina, Sameer Pujar,
	linux-tegra, Jerome Brunet, Neil Armstrong, Kevin Hilman,
	Martin Blumenstingl, linux-amlogic, Srinivas Kandagatla,
	Banajit Goswami, Kunihiko Hayashi, Masami Hiramatsu

Hello,

this is another series to convert ASoC drivers to use struct
platform_driver:remove_new(). The rockchip one was already send before
but with a wrong subject prefix, the cs42l43 driver is newer than the
last series. The remaining five patches are for driver combos that my
coccinelle patch failed to detect before.

Best regards
Uwe

Uwe Kleine-König (7):
  ASoC: rockchip: i2s_tdm: Convert to platform remove callback returning
    void
  ASoC: cs42l43: Convert to platform remove callback returning void
  ASoC: starfive/jh7110-pwmdac: Convert to platform remove callback
    returning void
  ASoC: simple-card-utils: Make simple_util_remove() return void
  ASoC: meson: Make meson_card_remove() return void
  ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return
    void
  ASoC: uniphier: Make uniphier_aio_remove() return void

 include/sound/simple_card_utils.h                   | 2 +-
 sound/soc/codecs/cs42l43.c                          | 6 ++----
 sound/soc/generic/audio-graph-card.c                | 2 +-
 sound/soc/generic/audio-graph-card2-custom-sample.c | 2 +-
 sound/soc/generic/audio-graph-card2.c               | 2 +-
 sound/soc/generic/simple-card-utils.c               | 4 +---
 sound/soc/generic/simple-card.c                     | 2 +-
 sound/soc/meson/axg-card.c                          | 2 +-
 sound/soc/meson/gx-card.c                           | 2 +-
 sound/soc/meson/meson-card-utils.c                  | 4 +---
 sound/soc/meson/meson-card.h                        | 2 +-
 sound/soc/qcom/lpass-apq8016.c                      | 2 +-
 sound/soc/qcom/lpass-cpu.c                          | 5 +----
 sound/soc/qcom/lpass-ipq806x.c                      | 2 +-
 sound/soc/qcom/lpass-sc7180.c                       | 2 +-
 sound/soc/qcom/lpass-sc7280.c                       | 2 +-
 sound/soc/qcom/lpass.h                              | 2 +-
 sound/soc/rockchip/rockchip_i2s_tdm.c               | 6 ++----
 sound/soc/starfive/jh7110_pwmdac.c                  | 5 ++---
 sound/soc/tegra/tegra_audio_graph_card.c            | 2 +-
 sound/soc/uniphier/aio-cpu.c                        | 4 +---
 sound/soc/uniphier/aio-ld11.c                       | 2 +-
 sound/soc/uniphier/aio-pxs2.c                       | 2 +-
 sound/soc/uniphier/aio.h                            | 2 +-
 24 files changed, 27 insertions(+), 41 deletions(-)


base-commit: e3b18f7200f45d66f7141136c25554ac1e82009b
-- 
2.42.0


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

* [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void
  2023-10-13 22:19 [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() Uwe Kleine-König
@ 2023-10-13 22:19 ` Uwe Kleine-König
  2023-10-14 12:23   ` Herve Codina
  2023-10-24 13:54 ` [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2023-10-13 22:19 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	Kuninori Morimoto, Rob Herring, AngeloGioacchino Del Regno,
	Wang Yufen, Aidan MacDonald, Jernej Skrabec, Claudiu Beznea,
	Astrid Rost, Robert Hancock, Herve Codina, Sameer Pujar,
	alsa-devel, kernel, linux-tegra

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code.  However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

simple_util_remove() returned zero unconditionally. Make it return void
instead and convert all users to struct platform_device::remove_new().

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 include/sound/simple_card_utils.h                   | 2 +-
 sound/soc/generic/audio-graph-card.c                | 2 +-
 sound/soc/generic/audio-graph-card2-custom-sample.c | 2 +-
 sound/soc/generic/audio-graph-card2.c               | 2 +-
 sound/soc/generic/simple-card-utils.c               | 4 +---
 sound/soc/generic/simple-card.c                     | 2 +-
 sound/soc/tegra/tegra_audio_graph_card.c            | 2 +-
 7 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 18e7a0b89395..e5da10b4c43b 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -188,7 +188,7 @@ int simple_util_init_aux_jacks(struct simple_util_priv *priv,
 				char *prefix);
 int simple_util_init_priv(struct simple_util_priv *priv,
 			       struct link_info *li);
-int simple_util_remove(struct platform_device *pdev);
+void simple_util_remove(struct platform_device *pdev);
 
 int graph_util_card_probe(struct snd_soc_card *card);
 int graph_util_is_ports0(struct device_node *port);
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 704f32bda24d..76a9f1e8cdd5 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -644,7 +644,7 @@ static struct platform_driver graph_card = {
 		.of_match_table = graph_of_match,
 	},
 	.probe = graph_probe,
-	.remove = simple_util_remove,
+	.remove_new = simple_util_remove,
 };
 module_platform_driver(graph_card);
 
diff --git a/sound/soc/generic/audio-graph-card2-custom-sample.c b/sound/soc/generic/audio-graph-card2-custom-sample.c
index 4dc65e249ecb..1b6ccd2de964 100644
--- a/sound/soc/generic/audio-graph-card2-custom-sample.c
+++ b/sound/soc/generic/audio-graph-card2-custom-sample.c
@@ -176,7 +176,7 @@ static struct platform_driver custom_card = {
 		.of_match_table = custom_of_match,
 	},
 	.probe	= custom_probe,
-	.remove	= simple_util_remove,
+	.remove_new = simple_util_remove,
 };
 module_platform_driver(custom_card);
 
diff --git a/sound/soc/generic/audio-graph-card2.c b/sound/soc/generic/audio-graph-card2.c
index 1344e1adfc67..7146611df730 100644
--- a/sound/soc/generic/audio-graph-card2.c
+++ b/sound/soc/generic/audio-graph-card2.c
@@ -1224,7 +1224,7 @@ static struct platform_driver graph_card = {
 		.of_match_table = graph_of_match,
 	},
 	.probe	= graph_probe,
-	.remove	= simple_util_remove,
+	.remove_new = simple_util_remove,
 };
 module_platform_driver(graph_card);
 
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 11f186ea662a..cfa70a56ff0f 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -958,13 +958,11 @@ int simple_util_init_priv(struct simple_util_priv *priv,
 }
 EXPORT_SYMBOL_GPL(simple_util_init_priv);
 
-int simple_util_remove(struct platform_device *pdev)
+void simple_util_remove(struct platform_device *pdev)
 {
 	struct snd_soc_card *card = platform_get_drvdata(pdev);
 
 	simple_util_clean_reference(card);
-
-	return 0;
 }
 EXPORT_SYMBOL_GPL(simple_util_remove);
 
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 048357ae7ae6..9c79ff6a568f 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -827,7 +827,7 @@ static struct platform_driver simple_card = {
 		.of_match_table = simple_of_match,
 	},
 	.probe = simple_probe,
-	.remove = simple_util_remove,
+	.remove_new = simple_util_remove,
 };
 
 module_platform_driver(simple_card);
diff --git a/sound/soc/tegra/tegra_audio_graph_card.c b/sound/soc/tegra/tegra_audio_graph_card.c
index 8b48813c2c59..feba9d42bbc5 100644
--- a/sound/soc/tegra/tegra_audio_graph_card.c
+++ b/sound/soc/tegra/tegra_audio_graph_card.c
@@ -248,7 +248,7 @@ static struct platform_driver tegra_audio_graph_card = {
 		.of_match_table = graph_of_tegra_match,
 	},
 	.probe = tegra_audio_graph_probe,
-	.remove = simple_util_remove,
+	.remove_new = simple_util_remove,
 };
 module_platform_driver(tegra_audio_graph_card);
 
-- 
2.42.0


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

* Re: [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void
  2023-10-13 22:19 ` [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void Uwe Kleine-König
@ 2023-10-14 12:23   ` Herve Codina
  0 siblings, 0 replies; 4+ messages in thread
From: Herve Codina @ 2023-10-14 12:23 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Thierry Reding, Jonathan Hunter, Kuninori Morimoto, Rob Herring,
	AngeloGioacchino Del Regno, Wang Yufen, Aidan MacDonald,
	Jernej Skrabec, Claudiu Beznea, Astrid Rost, Robert Hancock,
	Sameer Pujar, alsa-devel, kernel, linux-tegra

On Sat, 14 Oct 2023 00:19:50 +0200
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:

> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code.  However the value returned is (mostly) ignored
> and this typically results in resource leaks. To improve here there is a
> quest to make the remove callback return void. In the first step of this
> quest all drivers are converted to .remove_new() which already returns
> void.
> 
> simple_util_remove() returned zero unconditionally. Make it return void
> instead and convert all users to struct platform_device::remove_new().
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé

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

* Re: [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new()
  2023-10-13 22:19 [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() Uwe Kleine-König
  2023-10-13 22:19 ` [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void Uwe Kleine-König
@ 2023-10-24 13:54 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2023-10-24 13:54 UTC (permalink / raw)
  To: Liam Girdwood, Uwe Kleine-König
  Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, Heiko Stuebner,
	linux-rockchip, alsa-devel, linux-arm-kernel, kernel,
	James Schulman, David Rhodes, Richard Fitzgerald, patches,
	Hal Feng, Xingyu Wu, Thierry Reding, Jonathan Hunter,
	Kuninori Morimoto, Rob Herring, AngeloGioacchino Del Regno,
	Wang Yufen, Aidan MacDonald, Jernej Skrabec, Claudiu Beznea,
	Astrid Rost, Robert Hancock, Herve Codina, Sameer Pujar,
	linux-tegra, Jerome Brunet, Neil Armstrong, Kevin Hilman,
	Martin Blumenstingl, linux-amlogic, Srinivas Kandagatla,
	Banajit Goswami, Kunihiko Hayashi, Masami Hiramatsu

On Sat, 14 Oct 2023 00:19:46 +0200, Uwe Kleine-König wrote:
> this is another series to convert ASoC drivers to use struct
> platform_driver:remove_new(). The rockchip one was already send before
> but with a wrong subject prefix, the cs42l43 driver is newer than the
> last series. The remaining five patches are for driver combos that my
> coccinelle patch failed to detect before.
> 
> Best regards
> Uwe
> 
> [...]

Applied to

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

Thanks!

[1/7] ASoC: rockchip: i2s_tdm: Convert to platform remove callback returning void
      commit: 46dd58bef32dea55b663141858ca1659a85a1505
[2/7] ASoC: cs42l43: Convert to platform remove callback returning void
      commit: 491a1132f5cb77c8f1abb44d9928f8f184fc3df7
[3/7] ASoC: starfive/jh7110-pwmdac: Convert to platform remove callback returning void
      commit: 6b02f5a6f1853c6d5f73b000afbc177f5ee59d9e
[4/7] ASoC: simple-card-utils: Make simple_util_remove() return void
      commit: 393df6f321c757d164fa412b7eae527a8e2acb75
[5/7] ASoC: meson: Make meson_card_remove() return void
      commit: 8210f496c3e12410fa240c7fbc63f71ef78e253f
[6/7] ASoC: qcom: lpass: Make asoc_qcom_lpass_cpu_platform_remove() return void
      commit: d0cc676c426d1958989fac2a0d45179fb9992f0a
[7/7] ASoC: uniphier: Make uniphier_aio_remove() return void
      commit: 7242265213893e053457240f833d06ecd75b7ab3

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] 4+ messages in thread

end of thread, other threads:[~2023-10-24 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13 22:19 [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() Uwe Kleine-König
2023-10-13 22:19 ` [PATCH 4/7] ASoC: simple-card-utils: Make simple_util_remove() return void Uwe Kleine-König
2023-10-14 12:23   ` Herve Codina
2023-10-24 13:54 ` [PATCH 0/7] ASoc: Another series to convert to struct platform_driver:remove_new() 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).