OSDN Git Service

ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata
authorJulia Lawall <Julia.Lawall@inria.fr>
Sat, 13 Feb 2021 10:19:05 +0000 (11:19 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:07:06 +0000 (13:07 +0000)
commitb8fdf60931440296912e35bfe08b351fd3c37d11
tree18dbbea66feb2d3b3ba18a7acbd4a40370399252
parent64ca77d9f55afbbe5e63b1d290cade4acfb8e4fa
ASoC: mxs-saif: drop unneeded snd_soc_dai_set_drvdata

snd_soc_dai_set_drvdata is not needed when the set data comes from
snd_soc_dai_get_drvdata or dev_get_drvdata.  The problem was fixed
usingthe following semantic patch: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,y,e;
@@
x = dev_get_drvdata(y->dev)
... when != x = e
- snd_soc_dai_set_drvdata(y,x);

@@
expression x,y,e;
@@
x = snd_soc_dai_get_drvdata(y)
... when != x = e
- snd_soc_dai_set_drvdata(y,x);
// </smpl>

In this case, the whole probe function then does nothing, so drop it.

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Link: https://lore.kernel.org/r/20210213101907.1318496-3-Julia.Lawall@inria.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mxs/mxs-saif.c