[PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling

Johan Hovold posted 3 patches 1 month, 2 weeks ago
[PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
Posted by Johan Hovold 1 month, 2 weeks ago
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
Re: [PATCH 3/3] ASoC: soc_sdw_utils: drop bogus container_of() error handling
Posted by Konrad Dybcio 1 month, 2 weeks ago
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