diff options
author | Rob Herring <robh@kernel.org> | 2023-10-06 15:09:14 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-10-09 13:13:59 +0100 |
commit | 9958d85968ed2df4b704105fd2a9c3669eb9cd97 (patch) | |
tree | 6b7e35136e317d6546930b369159e1dca2468ad6 /sound/soc/intel/keembay | |
parent | ASoC: qcom/lpass: Constify struct lpass_variant (diff) | |
download | wireguard-linux-9958d85968ed2df4b704105fd2a9c3669eb9cd97.tar.xz wireguard-linux-9958d85968ed2df4b704105fd2a9c3669eb9cd97.zip |
ASoC: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231006-dt-asoc-header-cleanups-v3-5-13a4f0f7fee6@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/keembay')
-rw-r--r-- | sound/soc/intel/keembay/kmb_platform.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c index e929497a5eb5..37ea2e1d2e92 100644 --- a/sound/soc/intel/keembay/kmb_platform.c +++ b/sound/soc/intel/keembay/kmb_platform.c @@ -11,7 +11,6 @@ #include <linux/io.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <sound/dmaengine_pcm.h> #include <sound/pcm.h> #include <sound/pcm_params.h> @@ -820,7 +819,6 @@ static int kmb_plat_dai_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct snd_soc_dai_driver *kmb_i2s_dai; - const struct of_device_id *match; struct device *dev = &pdev->dev; struct kmb_i2s_info *kmb_i2s; struct resource *res; @@ -831,16 +829,7 @@ static int kmb_plat_dai_probe(struct platform_device *pdev) if (!kmb_i2s) return -ENOMEM; - kmb_i2s_dai = devm_kzalloc(dev, sizeof(*kmb_i2s_dai), GFP_KERNEL); - if (!kmb_i2s_dai) - return -ENOMEM; - - match = of_match_device(kmb_plat_of_match, &pdev->dev); - if (!match) { - dev_err(&pdev->dev, "Error: No device match found\n"); - return -ENODEV; - } - kmb_i2s_dai = (struct snd_soc_dai_driver *) match->data; + kmb_i2s_dai = (struct snd_soc_dai_driver *)device_get_match_data(&pdev->dev); /* Prepare the related clocks */ kmb_i2s->clk_apb = devm_clk_get(dev, "apb_clk"); |