[PATCH] 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 --- Note: This patch is only compile tested. --- sound/soc/codecs/tas571x.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 1756edb35961..a220342c3d77 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -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) {
On Sun, 27 Aug 2023 10:15:25 +0100, Biju Das wrote:
Simplify probe() by replacing of_match_device->i2c_get_match_data().
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: tas571x: Simplify probe() commit: e17e892dc8d1404a758d38ec870e44299f97d227
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Biju Das
-
Mark Brown