summaryrefslogtreecommitdiff
path: root/sound/soc/ti/davinci-mcasp.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-06 15:09:14 -0500
committerMark Brown <broonie@kernel.org>2023-10-09 13:13:59 +0100
commit9958d85968ed2df4b704105fd2a9c3669eb9cd97 (patch)
tree6b7e35136e317d6546930b369159e1dca2468ad6 /sound/soc/ti/davinci-mcasp.c
parentec5236c2e6ec1ce62237a2e9345dd2ffc4fc6d56 (diff)
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/ti/davinci-mcasp.c')
-rw-r--r--sound/soc/ti/davinci-mcasp.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c
index 7e7d665a5504..b892d66f7847 100644
--- a/sound/soc/ti/davinci-mcasp.c
+++ b/sound/soc/ti/davinci-mcasp.c
@@ -21,8 +21,6 @@
#include <linux/clk.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
-#include <linux/of_platform.h>
-#include <linux/of_device.h>
#include <linux/platform_data/davinci_asp.h>
#include <linux/math64.h>
#include <linux/bitmap.h>
@@ -1882,9 +1880,10 @@ static bool davinci_mcasp_have_gpiochip(struct davinci_mcasp *mcasp)
static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
struct platform_device *pdev)
{
- const struct of_device_id *match = of_match_device(mcasp_dt_ids, &pdev->dev);
struct device_node *np = pdev->dev.of_node;
struct davinci_mcasp_pdata *pdata = NULL;
+ const struct davinci_mcasp_pdata *match_pdata =
+ device_get_match_data(&pdev->dev);
const u32 *of_serial_dir32;
u32 val;
int i;
@@ -1893,8 +1892,8 @@ static int davinci_mcasp_get_config(struct davinci_mcasp *mcasp,
pdata = pdev->dev.platform_data;
pdata->dismod = DISMOD_LOW;
goto out;
- } else if (match) {
- pdata = devm_kmemdup(&pdev->dev, match->data, sizeof(*pdata),
+ } else if (match_pdata) {
+ pdata = devm_kmemdup(&pdev->dev, match_pdata, sizeof(*pdata),
GFP_KERNEL);
if (!pdata)
return -ENOMEM;