diff options
author | Tzung-Bi Shih <tzungbi@google.com> | 2021-12-27 14:21:53 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-29 12:45:45 +0000 |
commit | 3667a037e50a31555276a7989435126e501f0f15 (patch) | |
tree | ea5e634dcbae832bba7896be419ac6aff7eed242 /sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | |
parent | 8f85317292f1d99e8a70a400a46ee697d64e3326 (diff) | |
download | linux-stable-3667a037e50a31555276a7989435126e501f0f15.tar.gz linux-stable-3667a037e50a31555276a7989435126e501f0f15.tar.bz2 linux-stable-3667a037e50a31555276a7989435126e501f0f15.zip |
ASoC: mediatek: use of_device_get_match_data()
Uses of_device_get_match_data() helper to clean some boilerplate code.
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20211227062153.3887447-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c')
-rw-r--r-- | sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index ca893feab7eb..718505c75418 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -685,7 +685,6 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) struct snd_soc_dai_link *dai_link; struct mt8183_da7219_max98357_priv *priv; struct pinctrl *pinctrl; - const struct of_device_id *match; int ret, i; platform_node = of_parse_phandle(pdev->dev.of_node, @@ -695,11 +694,9 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) return -EINVAL; } - match = of_match_device(pdev->dev.driver->of_match_table, &pdev->dev); - if (!match || !match->data) + card = (struct snd_soc_card *)of_device_get_match_data(&pdev->dev); + if (!card) return -EINVAL; - - card = (struct snd_soc_card *)match->data; card->dev = &pdev->dev; hdmi_codec = of_parse_phandle(pdev->dev.of_node, |