public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Srinivas Kandagatla <srini@kernel.org>, Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, Johan Hovold <johan@kernel.org>,
	Alexey Klimov <alexey.klimov@linaro.org>
Subject: [PATCH 1/3] ASoC: codecs: pm4125: drop bogus container_of() error handling
Date: Fri, 19 Dec 2025 15:27:13 +0100	[thread overview]
Message-ID: <20251219142715.19254-2-johan@kernel.org> (raw)
In-Reply-To: <20251219142715.19254-1-johan@kernel.org>

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


  reply	other threads:[~2025-12-19 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19 14:27 [PATCH 0/3] ASoC: drop bogus container_of() error handling Johan Hovold
2025-12-19 14:27 ` Johan Hovold [this message]
2025-12-22  4:22   ` [PATCH 1/3] ASoC: codecs: pm4125: " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251219142715.19254-2-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=alexey.klimov@linaro.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=srini@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox