]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: codecs: wcd937x: drop bogus container_of() error handling
authorJohan Hovold <johan@kernel.org>
Fri, 19 Dec 2025 14:27:14 +0000 (15:27 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 22 Dec 2025 09:14:52 +0000 (09:14 +0000)
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>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://patch.msgid.link/20251219142715.19254-3-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wcd937x.c

index f4dbcf04be4922a6da10b809df8d18b7d1765b6f..10a2d598caa71ec546c2731334cff8dee2ec9990 100644 (file)
@@ -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.