alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] ASoC: tas2781: fix getting the wrong device number
@ 2025-11-07  5:49 Shenghao Ding
  2025-11-07 15:14 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Shenghao Ding @ 2025-11-07  5:49 UTC (permalink / raw)
  To: broonie
  Cc: andriy.shevchenko, tiwai, 13916275206, 13564923607, alsa-devel,
	baojun.xu, Shenghao Ding

The return value of device_property_read_u32_array used for getting the
property is the status instead of the number of the property.

Fixes: ef3bcde75d06 ("ASoC: tas2781: Add tas2781 driver")
Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
---
 sound/soc/codecs/tas2781-i2c.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c
index 8f853310649c..7bd98ff5a250 100644
--- a/sound/soc/codecs/tas2781-i2c.c
+++ b/sound/soc/codecs/tas2781-i2c.c
@@ -1958,7 +1958,8 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
 {
 	struct i2c_client *client = (struct i2c_client *)tas_priv->client;
 	unsigned int dev_addrs[TASDEVICE_MAX_CHANNELS];
-	int i, ndev = 0;
+	int ndev = 0;
+	int i, rc;
 
 	if (tas_priv->isacpi) {
 		ndev = device_property_read_u32_array(&client->dev,
@@ -1969,8 +1970,12 @@ static void tasdevice_parse_dt(struct tasdevice_priv *tas_priv)
 		} else {
 			ndev = (ndev < ARRAY_SIZE(dev_addrs))
 				? ndev : ARRAY_SIZE(dev_addrs);
-			ndev = device_property_read_u32_array(&client->dev,
+			rc = device_property_read_u32_array(&client->dev,
 				"ti,audio-slots", dev_addrs, ndev);
+			if (rc != 0) {
+				ndev = 1;
+				dev_addrs[0] = client->addr;
+			}
 		}
 
 		tas_priv->irq =
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] ASoC: tas2781: fix getting the wrong device number
  2025-11-07  5:49 [PATCH v1] ASoC: tas2781: fix getting the wrong device number Shenghao Ding
@ 2025-11-07 15:14 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-11-07 15:14 UTC (permalink / raw)
  To: Shenghao Ding
  Cc: andriy.shevchenko, tiwai, 13916275206, 13564923607, alsa-devel,
	baojun.xu

On Fri, 07 Nov 2025 13:49:59 +0800, Shenghao Ding wrote:
> The return value of device_property_read_u32_array used for getting the
> property is the status instead of the number of the property.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tas2781: fix getting the wrong device number
      commit: 29528c8e643bb0c54da01237a35010c6438423d2

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] 2+ messages in thread

end of thread, other threads:[~2025-11-07 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07  5:49 [PATCH v1] ASoC: tas2781: fix getting the wrong device number Shenghao Ding
2025-11-07 15:14 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).