[PATCH 00/15] ASoC: Drop empty platform remove functions
From: Uwe Kleine-König uwe@kleine-koenig.org
Hello,
this patch series removes all platform remove functions that only return zero below sound/soc. There is no reason to have these, as the only caller is platform core code doing:
if (drv->remove) { int ret = drv->remove(dev);
... }
(in platform_remove()) and so having no remove function is both equivalent and simpler.
Best regards Uwe
Uwe Kleine-König (15): ASoC: pxa: Drop empty platform remove function ASoC: amd: Drop empty platform remove function ASoC: atmel-classd: Drop empty platform remove function ASoC: atmel-pdmic: Drop empty platform remove function ASoC: 88pm860x: Drop empty platform remove function ASoC: ac97: Drop empty platform remove function ASoC: adau7002: Drop empty platform remove function ASoC: bt-sco: Drop empty platform remove function ASoC: cq93vc: Drop empty platform remove function ASoC: mc13783: Drop empty platform remove function ASoC: wl1273: Drop empty platform remove function ASoC: pxa: e740_wm9705: Drop empty platform remove function ASoC: pxa: e750_wm9705: Drop empty platform remove function ASoC: pxa: e800_wm9712: Drop empty platform remove function ASoC: SOF: nocodec: Drop empty platform remove function
sound/soc/amd/raven/acp3x-i2s.c | 8 -------- sound/soc/atmel/atmel-classd.c | 6 ------ sound/soc/atmel/atmel-pdmic.c | 6 ------ sound/soc/codecs/88pm860x-codec.c | 6 ------ sound/soc/codecs/ac97.c | 6 ------ sound/soc/codecs/adau7002.c | 6 ------ sound/soc/codecs/bt-sco.c | 6 ------ sound/soc/codecs/cq93vc.c | 6 ------ sound/soc/codecs/mc13783.c | 6 ------ sound/soc/codecs/wl1273.c | 6 ------ sound/soc/pxa/e740_wm9705.c | 6 ------ sound/soc/pxa/e750_wm9705.c | 6 ------ sound/soc/pxa/e800_wm9712.c | 6 ------ sound/soc/pxa/spitz.c | 6 ------ sound/soc/sof/nocodec.c | 6 ------ 15 files changed, 92 deletions(-)
base-commit: 3a28c2c89f4b412b648761430720d40a8dc326ef
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/pxa/spitz.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c index 44303b6eb228..70442315f5c5 100644 --- a/sound/soc/pxa/spitz.c +++ b/sound/soc/pxa/spitz.c @@ -306,18 +306,12 @@ static int spitz_probe(struct platform_device *pdev) return ret; }
-static int spitz_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver spitz_driver = { .driver = { .name = "spitz-audio", .pm = &snd_soc_pm_ops, }, .probe = spitz_probe, - .remove = spitz_remove, };
module_platform_driver(spitz_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/amd/raven/acp3x-i2s.c | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c index aa38cef1776d..4ba83689482a 100644 --- a/sound/soc/amd/raven/acp3x-i2s.c +++ b/sound/soc/amd/raven/acp3x-i2s.c @@ -315,16 +315,8 @@ static int acp3x_dai_probe(struct platform_device *pdev) return 0; }
-static int acp3x_dai_remove(struct platform_device *pdev) -{ - /* As we use devm_ memory alloc there is nothing TBD here */ - - return 0; -} - static struct platform_driver acp3x_dai_driver = { .probe = acp3x_dai_probe, - .remove = acp3x_dai_remove, .driver = { .name = "acp3x_i2s_playcap", },
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/atmel/atmel-classd.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 87d6d6ed026b..9883e6867fd1 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -616,11 +616,6 @@ static int atmel_classd_probe(struct platform_device *pdev) return ret; }
-static int atmel_classd_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver atmel_classd_driver = { .driver = { .name = "atmel-classd", @@ -628,7 +623,6 @@ static struct platform_driver atmel_classd_driver = { .pm = &snd_soc_pm_ops, }, .probe = atmel_classd_probe, - .remove = atmel_classd_remove, }; module_platform_driver(atmel_classd_driver);
On 12.12.2022 22:53, Uwe Kleine-König wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de
Reviewed-by: Claudiu Beznea claudiu.beznea@microchip.com
sound/soc/atmel/atmel-classd.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c index 87d6d6ed026b..9883e6867fd1 100644 --- a/sound/soc/atmel/atmel-classd.c +++ b/sound/soc/atmel/atmel-classd.c @@ -616,11 +616,6 @@ static int atmel_classd_probe(struct platform_device *pdev) return ret; }
-static int atmel_classd_remove(struct platform_device *pdev) -{
return 0;
-}
static struct platform_driver atmel_classd_driver = { .driver = { .name = "atmel-classd", @@ -628,7 +623,6 @@ static struct platform_driver atmel_classd_driver = { .pm = &snd_soc_pm_ops, }, .probe = atmel_classd_probe,
.remove = atmel_classd_remove,
}; module_platform_driver(atmel_classd_driver);
-- 2.38.1
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/atmel/atmel-pdmic.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c index 77ff12baead5..12cd40b15644 100644 --- a/sound/soc/atmel/atmel-pdmic.c +++ b/sound/soc/atmel/atmel-pdmic.c @@ -692,11 +692,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev) return ret; }
-static int atmel_pdmic_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver atmel_pdmic_driver = { .driver = { .name = "atmel-pdmic", @@ -704,7 +699,6 @@ static struct platform_driver atmel_pdmic_driver = { .pm = &snd_soc_pm_ops, }, .probe = atmel_pdmic_probe, - .remove = atmel_pdmic_remove, }; module_platform_driver(atmel_pdmic_driver);
On 12.12.2022 22:53, Uwe Kleine-König wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de
Reviewed-by: Claudiu Beznea claudiu.beznea@microchip.com
sound/soc/atmel/atmel-pdmic.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/atmel/atmel-pdmic.c b/sound/soc/atmel/atmel-pdmic.c index 77ff12baead5..12cd40b15644 100644 --- a/sound/soc/atmel/atmel-pdmic.c +++ b/sound/soc/atmel/atmel-pdmic.c @@ -692,11 +692,6 @@ static int atmel_pdmic_probe(struct platform_device *pdev) return ret; }
-static int atmel_pdmic_remove(struct platform_device *pdev) -{
return 0;
-}
static struct platform_driver atmel_pdmic_driver = { .driver = { .name = "atmel-pdmic", @@ -704,7 +699,6 @@ static struct platform_driver atmel_pdmic_driver = { .pm = &snd_soc_pm_ops, }, .probe = atmel_pdmic_probe,
.remove = atmel_pdmic_remove,
}; module_platform_driver(atmel_pdmic_driver);
-- 2.38.1
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/88pm860x-codec.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index fc65283031cd..3574c68e0dda 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c @@ -1386,17 +1386,11 @@ static int pm860x_codec_probe(struct platform_device *pdev) return ret; }
-static int pm860x_codec_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver pm860x_codec_driver = { .driver = { .name = "88pm860x-codec", }, .probe = pm860x_codec_probe, - .remove = pm860x_codec_remove, };
module_platform_driver(pm860x_codec_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/ac97.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index cc12052e1920..0e013edfe63d 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -127,18 +127,12 @@ static int ac97_probe(struct platform_device *pdev) &soc_component_dev_ac97, &ac97_dai, 1); }
-static int ac97_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver ac97_codec_driver = { .driver = { .name = "ac97-codec", },
.probe = ac97_probe, - .remove = ac97_remove, };
module_platform_driver(ac97_codec_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/adau7002.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/adau7002.c b/sound/soc/codecs/adau7002.c index 401bafabc8eb..c9134e1de0b2 100644 --- a/sound/soc/codecs/adau7002.c +++ b/sound/soc/codecs/adau7002.c @@ -100,11 +100,6 @@ static int adau7002_probe(struct platform_device *pdev) &adau7002_dai, 1); }
-static int adau7002_remove(struct platform_device *pdev) -{ - return 0; -} - #ifdef CONFIG_OF static const struct of_device_id adau7002_dt_ids[] = { { .compatible = "adi,adau7002", }, @@ -128,7 +123,6 @@ static struct platform_driver adau7002_driver = { .acpi_match_table = ACPI_PTR(adau7002_acpi_match), }, .probe = adau7002_probe, - .remove = adau7002_remove, }; module_platform_driver(adau7002_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/bt-sco.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/bt-sco.c b/sound/soc/codecs/bt-sco.c index 4086b6a53de8..3afcef2dfa35 100644 --- a/sound/soc/codecs/bt-sco.c +++ b/sound/soc/codecs/bt-sco.c @@ -78,11 +78,6 @@ static int bt_sco_probe(struct platform_device *pdev) bt_sco_dai, ARRAY_SIZE(bt_sco_dai)); }
-static int bt_sco_remove(struct platform_device *pdev) -{ - return 0; -} - static const struct platform_device_id bt_sco_driver_ids[] = { { .name = "dfbmcs320", @@ -109,7 +104,6 @@ static struct platform_driver bt_sco_driver = { .of_match_table = of_match_ptr(bt_sco_codec_of_match), }, .probe = bt_sco_probe, - .remove = bt_sco_remove, .id_table = bt_sco_driver_ids, };
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/cq93vc.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index 14403b76c724..32b6a417d0e8 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c @@ -134,18 +134,12 @@ static int cq93vc_platform_probe(struct platform_device *pdev) &soc_component_dev_cq93vc, &cq93vc_dai, 1); }
-static int cq93vc_platform_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver cq93vc_codec_driver = { .driver = { .name = "cq93vc-codec", },
.probe = cq93vc_platform_probe, - .remove = cq93vc_platform_remove, };
module_platform_driver(cq93vc_codec_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/mc13783.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 71490f11d96a..086ac97e8386 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -776,16 +776,10 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) return ret; }
-static int mc13783_codec_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver mc13783_codec_driver = { .driver = { .name = "mc13783-codec", }, - .remove = mc13783_codec_remove, }; module_platform_driver_probe(mc13783_codec_driver, mc13783_codec_probe);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/codecs/wl1273.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index 626278e4c923..737ca82cf976 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -484,11 +484,6 @@ static int wl1273_platform_probe(struct platform_device *pdev) &wl1273_dai, 1); }
-static int wl1273_platform_remove(struct platform_device *pdev) -{ - return 0; -} - MODULE_ALIAS("platform:wl1273-codec");
static struct platform_driver wl1273_platform_driver = { @@ -496,7 +491,6 @@ static struct platform_driver wl1273_platform_driver = { .name = "wl1273-codec", }, .probe = wl1273_platform_probe, - .remove = wl1273_platform_remove, };
module_platform_driver(wl1273_platform_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/pxa/e740_wm9705.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index 4e0e9b778d4c..ec37da331a91 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c @@ -145,18 +145,12 @@ static int e740_probe(struct platform_device *pdev) return ret; }
-static int e740_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver e740_driver = { .driver = { .name = "e740-audio", .pm = &snd_soc_pm_ops, }, .probe = e740_probe, - .remove = e740_remove, };
module_platform_driver(e740_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/pxa/e750_wm9705.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/pxa/e750_wm9705.c b/sound/soc/pxa/e750_wm9705.c index 7a1e0d8bfd11..60b22d4f92a7 100644 --- a/sound/soc/pxa/e750_wm9705.c +++ b/sound/soc/pxa/e750_wm9705.c @@ -124,18 +124,12 @@ static int e750_probe(struct platform_device *pdev) return ret; }
-static int e750_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver e750_driver = { .driver = { .name = "e750-audio", .pm = &snd_soc_pm_ops, }, .probe = e750_probe, - .remove = e750_remove, };
module_platform_driver(e750_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/pxa/e800_wm9712.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index a39c494127cf..c7756acd888a 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c @@ -124,18 +124,12 @@ static int e800_probe(struct platform_device *pdev) return ret; }
-static int e800_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver e800_driver = { .driver = { .name = "e800-audio", .pm = &snd_soc_pm_ops, }, .probe = e800_probe, - .remove = e800_remove, };
module_platform_driver(e800_driver);
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de --- sound/soc/sof/nocodec.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c index 3537805070ad..b13bfdeb2b70 100644 --- a/sound/soc/sof/nocodec.c +++ b/sound/soc/sof/nocodec.c @@ -103,14 +103,8 @@ static int sof_nocodec_probe(struct platform_device *pdev) return devm_snd_soc_register_card(&pdev->dev, card); }
-static int sof_nocodec_remove(struct platform_device *pdev) -{ - return 0; -} - static struct platform_driver sof_nocodec_audio = { .probe = sof_nocodec_probe, - .remove = sof_nocodec_remove, .driver = { .name = "sof-nocodec", .pm = &snd_soc_pm_ops,
On 12/12/22 14:54, Uwe Kleine-König wrote:
A remove callback just returning 0 is equivalent to no remove callback at all. So drop the useless function.
Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de
Reviewed-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com
sound/soc/sof/nocodec.c | 6 ------ 1 file changed, 6 deletions(-)
diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c index 3537805070ad..b13bfdeb2b70 100644 --- a/sound/soc/sof/nocodec.c +++ b/sound/soc/sof/nocodec.c @@ -103,14 +103,8 @@ static int sof_nocodec_probe(struct platform_device *pdev) return devm_snd_soc_register_card(&pdev->dev, card); }
-static int sof_nocodec_remove(struct platform_device *pdev) -{
- return 0;
-}
static struct platform_driver sof_nocodec_audio = { .probe = sof_nocodec_probe,
- .remove = sof_nocodec_remove, .driver = { .name = "sof-nocodec", .pm = &snd_soc_pm_ops,
On Mon, 12 Dec 2022 21:53:51 +0100, Uwe Kleine-König wrote:
this patch series removes all platform remove functions that only return zero below sound/soc. There is no reason to have these, as the only caller is platform core code doing:
if (drv->remove) { int ret = drv->remove(dev);
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[01/15] ASoC: pxa: Drop empty platform remove function commit: e812aa458acf7c47f9f5d8e6c62177317a998263 [02/15] ASoC: amd: Drop empty platform remove function commit: 001c6df098834eb5eaa36a2b121bd6a675b38aa9 [03/15] ASoC: atmel-classd: Drop empty platform remove function commit: 9d5664fdf6a89e66f806763d76f18337ab3cb18a [04/15] ASoC: atmel-pdmic: Drop empty platform remove function commit: edf2ceb9a2a279d350fdb57c1930554c8675b2b1 [05/15] ASoC: 88pm860x: Drop empty platform remove function commit: 9fbfe1d1acf596b5ba9ddbb145c7be6a09b2f1eb [06/15] ASoC: ac97: Drop empty platform remove function commit: 7de12b06eeb2fbe3732e96ae40e38159700f61ec [07/15] ASoC: adau7002: Drop empty platform remove function commit: 06e8ce87356e7751ffea831396f8b3129a805d28 [08/15] ASoC: bt-sco: Drop empty platform remove function commit: f9cc66890fb8d695e38486595851701dbfa22487 [09/15] ASoC: cq93vc: Drop empty platform remove function commit: 61f62f1fcf7e4a3cb347d2d4c9696dd725c922f0 [10/15] ASoC: mc13783: Drop empty platform remove function commit: 140212aefce754f230a28751415c71705f7e3ffa [11/15] ASoC: wl1273: Drop empty platform remove function commit: d09751b3523eb0d6bea345bda99b2f5417feb2ff [12/15] ASoC: pxa: e740_wm9705: Drop empty platform remove function commit: f2211ac36ab0b175cca7a244560923fbeeb6c7ae [13/15] ASoC: pxa: e750_wm9705: Drop empty platform remove function commit: 4ed923e8076b8728c1c1cf587b79a83e34de22b0 [14/15] ASoC: pxa: e800_wm9712: Drop empty platform remove function commit: 394296eee2c220283ebc835db61ba4531f865558 [15/15] ASoC: SOF: nocodec: Drop empty platform remove function commit: 603d96c917b2e8c2146069bf7db1468fd87f800b
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
participants (4)
-
Claudiu.Beznea@microchip.com
-
Mark Brown
-
Pierre-Louis Bossart
-
Uwe Kleine-König