mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
ASoC: tas2781: fix getting the wrong device number
[ Upstream commit29528c8e64] 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:ef3bcde75d("ASoC: tas2781: Add tas2781 driver") Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> Link: https://patch.msgid.link/20251107054959.950-1-shenghao-ding@ti.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5aea2cde03
commit
f2fcc305b4
@@ -1635,7 +1635,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,
|
||||
@@ -1646,8 +1647,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 =
|
||||
|
||||
Reference in New Issue
Block a user