Skip to content

Commit

Permalink
ASoC: cs42l56: fix DT probe
Browse files Browse the repository at this point in the history
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: Arnd Bergmann <[email protected]>
Acked-by: Charles Keepax <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
arndb authored and broonie committed Jan 26, 2023
1 parent 100c94f commit e18c6da
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions sound/soc/codecs/cs42l56.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,18 +1191,12 @@ static int cs42l56_i2c_probe(struct i2c_client *i2c_client)
if (pdata) {
cs42l56->pdata = *pdata;
} else {
pdata = devm_kzalloc(&i2c_client->dev, sizeof(*pdata),
GFP_KERNEL);
if (!pdata)
return -ENOMEM;

if (i2c_client->dev.of_node) {
ret = cs42l56_handle_of_data(i2c_client,
&cs42l56->pdata);
if (ret != 0)
return ret;
}
cs42l56->pdata = *pdata;
}

if (cs42l56->pdata.gpio_nreset) {
Expand Down

0 comments on commit e18c6da

Please sign in to comment.