Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: tas571x: Simplify probe()

Simplify probe() by replacing of_match_device->i2c_get_match_data().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230827091525.39263-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Biju Das and committed by
Mark Brown
e17e892d c3c9b17d

+1 -12
+1 -12
sound/soc/codecs/tas571x.c
··· 829 829 .ops = &tas571x_dai_ops, 830 830 }; 831 831 832 - static const struct of_device_id tas571x_of_match[] __maybe_unused; 833 - static const struct i2c_device_id tas571x_i2c_id[]; 834 - 835 832 static int tas571x_i2c_probe(struct i2c_client *client) 836 833 { 837 834 struct tas571x_private *priv; 838 835 struct device *dev = &client->dev; 839 - const struct of_device_id *of_id; 840 836 int i, ret; 841 837 842 838 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 840 844 return -ENOMEM; 841 845 i2c_set_clientdata(client, priv); 842 846 843 - of_id = of_match_device(tas571x_of_match, dev); 844 - if (of_id) 845 - priv->chip = of_id->data; 846 - else { 847 - const struct i2c_device_id *id = 848 - i2c_match_id(tas571x_i2c_id, client); 849 - priv->chip = (void *) id->driver_data; 850 - } 847 + priv->chip = i2c_get_match_data(client); 851 848 852 849 priv->mclk = devm_clk_get(dev, "mclk"); 853 850 if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {