* [PATCH 0/3] ASoC: drop bogus container_of() error handling
@ 2025-12-19 14:27 Johan Hovold
2025-12-19 14:27 ` [PATCH 1/3] ASoC: codecs: pm4125: " Johan Hovold
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Johan Hovold @ 2025-12-19 14:27 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Johan Hovold
The dev_to_sdw_dev() helper uses container_of() to return the containing
soundwire device structure of its pointer argument and will never
return NULL.
Johan
Johan (3):
ASoC: codecs: pm4125: drop bogus container_of() error handling
ASoC: codecs: wcd937x: drop bogus container_of() error handling
ASoC: soc_sdw_utils: drop bogus container_of() error handling
sound/soc/codecs/pm4125.c | 6 ------
sound/soc/codecs/wcd937x.c | 5 -----
sound/soc/sdw_utils/soc_sdw_utils.c | 4 ----
3 files changed, 15 deletions(-)
--
2.51.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/3] ASoC: codecs: pm4125: drop bogus container_of() error handling
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
@ 2025-12-19 14:27 ` Johan Hovold
2025-12-22 4:22 ` Alexey Klimov
2025-12-19 14:27 ` [PATCH 2/3] ASoC: codecs: wcd937x: " Johan Hovold
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Johan Hovold @ 2025-12-19 14:27 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Johan Hovold, Alexey Klimov
The dev_to_sdw_dev() helper uses container_of() to return the containing
soundwire device structure of its pointer argument and will never return
NULL.
Fixes: 8ad529484937 ("ASoC: codecs: add new pm4125 audio codec driver")
Cc: Alexey Klimov <alexey.klimov@linaro.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/codecs/pm4125.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/sound/soc/codecs/pm4125.c b/sound/soc/codecs/pm4125.c
index 43dcafff6c77..1f0a3f5389f1 100644
--- a/sound/soc/codecs/pm4125.c
+++ b/sound/soc/codecs/pm4125.c
@@ -1533,13 +1533,7 @@ static int pm4125_bind(struct device *dev)
pm4125->sdw_priv[AIF1_CAP] = dev_get_drvdata(pm4125->txdev);
pm4125->sdw_priv[AIF1_CAP]->pm4125 = pm4125;
-
pm4125->tx_sdw_dev = dev_to_sdw_dev(pm4125->txdev);
- if (!pm4125->tx_sdw_dev) {
- dev_err(dev, "could not get txslave with matching of dev\n");
- ret = -EINVAL;
- goto error_put_tx;
- }
/*
* As TX is the main CSR reg interface, which should not be suspended first.
--
2.51.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] ASoC: codecs: wcd937x: drop bogus container_of() error handling
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
2025-12-19 14:27 ` [PATCH 1/3] ASoC: codecs: pm4125: " Johan Hovold
@ 2025-12-19 14:27 ` Johan Hovold
2025-12-19 14:27 ` [PATCH 3/3] ASoC: soc_sdw_utils: " Johan Hovold
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Johan Hovold @ 2025-12-19 14:27 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Johan Hovold, Prasad Kumpatla
The dev_to_sdw_dev() helper uses container_of() to return the containing
soundwire device structure of its pointer argument and will never return
NULL.
Fixes: 9be3ec196da4 ("ASoC: codecs: wcd937x: add wcd937x codec driver")
Cc: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/codecs/wcd937x.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
index f4dbcf04be49..10a2d598caa7 100644
--- a/sound/soc/codecs/wcd937x.c
+++ b/sound/soc/codecs/wcd937x.c
@@ -2763,11 +2763,6 @@ static int wcd937x_bind(struct device *dev)
wcd937x->sdw_priv[AIF1_CAP] = dev_get_drvdata(wcd937x->txdev);
wcd937x->sdw_priv[AIF1_CAP]->wcd937x = wcd937x;
wcd937x->tx_sdw_dev = dev_to_sdw_dev(wcd937x->txdev);
- if (!wcd937x->tx_sdw_dev) {
- dev_err(dev, "could not get txslave with matching of dev\n");
- ret = -EINVAL;
- goto err_put_txdev;
- }
/*
* As TX is the main CSR reg interface, which should not be suspended first.
--
2.51.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
2025-12-19 14:27 ` [PATCH 1/3] ASoC: codecs: pm4125: " Johan Hovold
2025-12-19 14:27 ` [PATCH 2/3] ASoC: codecs: wcd937x: " Johan Hovold
@ 2025-12-19 14:27 ` Johan Hovold
2025-12-19 14:47 ` Konrad Dybcio
2025-12-20 18:56 ` [PATCH 0/3] ASoC: " Dmitry Baryshkov
2025-12-22 22:56 ` Mark Brown
4 siblings, 1 reply; 8+ messages in thread
From: Johan Hovold @ 2025-12-19 14:27 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Johan Hovold, Bard Liao
The dev_to_sdw_dev() helper uses container_of() to return the containing
soundwire device structure of its pointer argument and will never return
NULL.
Fixes: 4f8ef33dd44a ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/sdw_utils/soc_sdw_utils.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c
index 6c656b2f7f3a..f62e291c089f 100644
--- a/sound/soc/sdw_utils/soc_sdw_utils.c
+++ b/sound/soc/sdw_utils/soc_sdw_utils.c
@@ -1414,10 +1414,6 @@ static int is_sdca_endpoint_present(struct device *dev,
}
slave = dev_to_sdw_dev(sdw_dev);
- if (!slave) {
- ret = -EINVAL;
- goto put_device;
- }
/* Make sure BIOS provides SDCA properties */
if (!slave->sdca_data.interface_revision) {
--
2.51.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
2025-12-19 14:27 ` [PATCH 3/3] ASoC: soc_sdw_utils: " Johan Hovold
@ 2025-12-19 14:47 ` Konrad Dybcio
0 siblings, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2025-12-19 14:47 UTC (permalink / raw)
To: Johan Hovold, Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Bard Liao
On 12/19/25 3:27 PM, Johan Hovold wrote:
> The dev_to_sdw_dev() helper uses container_of() to return the containing
> soundwire device structure of its pointer argument and will never return
> NULL.
>
> Fixes: 4f8ef33dd44a ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
> Cc: Bard Liao <yung-chuan.liao@linux.intel.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] ASoC: drop bogus container_of() error handling
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
` (2 preceding siblings ...)
2025-12-19 14:27 ` [PATCH 3/3] ASoC: soc_sdw_utils: " Johan Hovold
@ 2025-12-20 18:56 ` Dmitry Baryshkov
2025-12-22 22:56 ` Mark Brown
4 siblings, 0 replies; 8+ messages in thread
From: Dmitry Baryshkov @ 2025-12-20 18:56 UTC (permalink / raw)
To: Johan Hovold
Cc: Srinivas Kandagatla, Mark Brown, Liam Girdwood, linux-sound,
linux-arm-msm, linux-kernel
On Fri, Dec 19, 2025 at 03:27:12PM +0100, Johan Hovold wrote:
> The dev_to_sdw_dev() helper uses container_of() to return the containing
> soundwire device structure of its pointer argument and will never
> return NULL.
>
> Johan
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] ASoC: codecs: pm4125: drop bogus container_of() error handling
2025-12-19 14:27 ` [PATCH 1/3] ASoC: codecs: pm4125: " Johan Hovold
@ 2025-12-22 4:22 ` Alexey Klimov
0 siblings, 0 replies; 8+ messages in thread
From: Alexey Klimov @ 2025-12-22 4:22 UTC (permalink / raw)
To: Johan Hovold, Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel
On Fri Dec 19, 2025 at 2:27 PM GMT, Johan Hovold wrote:
> The dev_to_sdw_dev() helper uses container_of() to return the containing
> soundwire device structure of its pointer argument and will never return
> NULL.
>
> Fixes: 8ad529484937 ("ASoC: codecs: add new pm4125 audio codec driver")
> Cc: Alexey Klimov <alexey.klimov@linaro.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>
I was about to ask to check other drivers/codecs, most likely
wcd937x as one of the reference points to pm4125 codec,
but you already did. Thank you for checking this.
Acked-by: Alexey Klimov <alexey.klimov@linaro.org>
Best regards,
Alexey
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/3] ASoC: drop bogus container_of() error handling
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
` (3 preceding siblings ...)
2025-12-20 18:56 ` [PATCH 0/3] ASoC: " Dmitry Baryshkov
@ 2025-12-22 22:56 ` Mark Brown
4 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2025-12-22 22:56 UTC (permalink / raw)
To: Srinivas Kandagatla, Johan Hovold
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel
On Fri, 19 Dec 2025 15:27:12 +0100, Johan Hovold wrote:
> The dev_to_sdw_dev() helper uses container_of() to return the containing
> soundwire device structure of its pointer argument and will never
> return NULL.
>
> Johan
>
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: codecs: pm4125: drop bogus container_of() error handling
commit: 54fa71f5f965fa3ec8846cef9d1154bcb2ba2850
[2/3] ASoC: codecs: wcd937x: drop bogus container_of() error handling
commit: 61a50d6f58b41e8a7e68d8fc8fc6bfbe30d790d8
[3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
commit: 870b10f61d527fec594e0888f18cc4f32c47433d
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] 8+ messages in thread
end of thread, other threads:[~2025-12-22 22:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
2025-12-19 14:27 ` [PATCH 1/3] ASoC: codecs: pm4125: " Johan Hovold
2025-12-22 4:22 ` Alexey Klimov
2025-12-19 14:27 ` [PATCH 2/3] ASoC: codecs: wcd937x: " Johan Hovold
2025-12-19 14:27 ` [PATCH 3/3] ASoC: soc_sdw_utils: " Johan Hovold
2025-12-19 14:47 ` Konrad Dybcio
2025-12-20 18:56 ` [PATCH 0/3] ASoC: " Dmitry Baryshkov
2025-12-22 22:56 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox