Commit e18c6da6 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown

ASoC: cs42l56: fix DT probe

While looking through legacy platform data users, I noticed that
the DT probing never uses data from the DT properties, as the
platform_data structure gets overwritten directly after it
is initialized.

There have never been any boards defining the platform_data in
the mainline kernel either, so this driver so far only worked
with patched kernels or with the default values.

For the benefit of possible downstream users, fix the DT probe
by no longer overwriting the data.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230126162203.2986339-1-arnd@kernel.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 100c94ff
...@@ -1191,18 +1191,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client) ...@@ -1191,18 +1191,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
if (pdata) { if (pdata) {
cs42l56->pdata = *pdata; cs42l56->pdata = *pdata;
} else { } else {
pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
GFP_KERNEL);
if (!pdata)
return -ENOMEM;
if (i2c_client->dev.of_node) { if (i2c_client->dev.of_node) {
ret = cs42l56_handle_of_data(i2c_client, ret = cs42l56_handle_of_data(i2c_client,
&cs42l56->pdata); &cs42l56->pdata);
if (ret != 0) if (ret != 0)
return ret; return ret;
} }
cs42l56->pdata = *pdata;
} }
if (cs42l56->pdata.gpio_nreset) { if (cs42l56->pdata.gpio_nreset) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment