ASoC: tas571x: Simplify probe()
authorBiju Das <biju.das.jz@bp.renesas.com>
Sun, 27 Aug 2023 09:15:25 +0000 (10:15 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 11 Sep 2023 00:30:05 +0000 (01:30 +0100)
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>
sound/soc/codecs/tas571x.c

index 1756edb35961a603a37c62ab4bf0b1b18c375153..a220342c3d77a513dcff80ff62d18791acbbd651 100644 (file)
@@ -829,14 +829,10 @@ static struct snd_soc_dai_driver tas571x_dai = {
        .ops = &tas571x_dai_ops,
 };
 
-static const struct of_device_id tas571x_of_match[] __maybe_unused;
-static const struct i2c_device_id tas571x_i2c_id[];
-
 static int tas571x_i2c_probe(struct i2c_client *client)
 {
        struct tas571x_private *priv;
        struct device *dev = &client->dev;
-       const struct of_device_id *of_id;
        int i, ret;
 
        priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
@@ -844,14 +840,7 @@ static int tas571x_i2c_probe(struct i2c_client *client)
                return -ENOMEM;
        i2c_set_clientdata(client, priv);
 
-       of_id = of_match_device(tas571x_of_match, dev);
-       if (of_id)
-               priv->chip = of_id->data;
-       else {
-               const struct i2c_device_id *id =
-                       i2c_match_id(tas571x_i2c_id, client);
-               priv->chip = (void *) id->driver_data;
-       }
+       priv->chip = i2c_get_match_data(client);
 
        priv->mclk = devm_clk_get(dev, "mclk");
        if (IS_ERR(priv->mclk) && PTR_ERR(priv->mclk) != -ENOENT) {