Skip to content

Commit

Permalink
ASoC: ak4642: Use of_device_get_match_data()
Browse files Browse the repository at this point in the history
Use of_device_get_match_data() to simplify the code.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20220315023226.2118354-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Minghao Chi authored and Mark Brown committed Mar 16, 2022
1 parent 1c19601 commit 835ca59
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions sound/soc/codecs/ak4613.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,15 +653,10 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
struct ak4613_priv *priv;

regmap_cfg = NULL;
if (np) {
const struct of_device_id *of_id;

of_id = of_match_device(ak4613_of_match, dev);
if (of_id)
regmap_cfg = of_id->data;
} else {
if (np)
regmap_cfg = of_device_get_match_data(dev);
else
regmap_cfg = (const struct regmap_config *)id->driver_data;
}

if (!regmap_cfg)
return -EINVAL;
Expand Down

0 comments on commit 835ca59

Please sign in to comment.