ASoC: drop bogus container_of() error handling
Subsystems (4)
cover ASoC: drop bogus container_of() error handling
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(-)
Signature · 1 line
2.51.2
PATCH 1/3 ASoC: codecs: pm4125: drop bogus container_of() error handling
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.
--- sound/soc/codecs/pm4125.c | 6 ------ 1 file changed, 6 deletions(-)
sound/soc/codecs/pm4125.c +0 -6
@@ -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.
Signature · 1 line
2.51.2
Re: [PATCH 1/3] ASoC: codecs: pm4125: drop bogus container_of() error handling
Quoted 7 lines · Johan Hovold
The
dev_to_sdw_dev()helper usescontainer_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 <[email protected]>Signed-off-by Johan Hovold <[email protected]>
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.
Best regards,
Alexey
PATCH 2/3 ASoC: codecs: wcd937x: drop bogus container_of() error handling
In reply to Johan HovoldThe dev_to_sdw_dev() helper uses container_of() to return the containing soundwire device structure of its pointer argument and will never return NULL.
--- sound/soc/codecs/wcd937x.c | 5 ----- 1 file changed, 5 deletions(-)
sound/soc/codecs/wcd937x.c +0 -5
@@ -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.
Signature · 1 line
2.51.2
PATCH 3/3 ASoC: soc_sdw_utils: drop bogus container_of() error handling
In reply to Johan HovoldThe dev_to_sdw_dev() helper uses container_of() to return the containing soundwire device structure of its pointer argument and will never return NULL.
--- sound/soc/sdw_utils/soc_sdw_utils.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/sdw_utils/soc_sdw_utils.c +0 -4
@@ -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) {
Signature · 1 line
2.51.2
Re: [PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
Quoted 8 lines · Johan Hovold
The
dev_to_sdw_dev()helper usescontainer_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 <[email protected]>Signed-off-by Johan Hovold <[email protected]>---
Konrad
Quoted 6 lines · Johan Hovold
The
dev_to_sdw_dev()helper usescontainer_of()to return the containing soundwire device structure of its pointer argument and will never return NULL.Johan
Signature · 2 lines
With best wishes Dmitry
Mark Brown
maintainerQuoted 8 lines · Johan Hovold
The
dev_to_sdw_dev()helper usescontainer_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: 870b10f61d527fec594e0888f18cc4f32c47433dAll 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