Skip to content

Commit 835ca59

Browse files
Minghao Chibroonie
authored andcommitted
ASoC: ak4642: Use of_device_get_match_data()
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>
1 parent 1c19601 commit 835ca59

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

sound/soc/codecs/ak4613.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,15 +653,10 @@ static int ak4613_i2c_probe(struct i2c_client *i2c,
653653
struct ak4613_priv *priv;
654654

655655
regmap_cfg = NULL;
656-
if (np) {
657-
const struct of_device_id *of_id;
658-
659-
of_id = of_match_device(ak4613_of_match, dev);
660-
if (of_id)
661-
regmap_cfg = of_id->data;
662-
} else {
656+
if (np)
657+
regmap_cfg = of_device_get_match_data(dev);
658+
else
663659
regmap_cfg = (const struct regmap_config *)id->driver_data;
664-
}
665660

666661
if (!regmap_cfg)
667662
return -EINVAL;

0 commit comments

Comments
 (0)