diff options
author | Rob Herring <robh@kernel.org> | 2023-10-07 00:38:43 +0300 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-10-09 08:24:48 +0300 |
commit | a67ba97dfb30486deb4661f770b954387acc898d (patch) | |
tree | 8fb9a02a53c281372134edba8a0e7646cc0950f8 /drivers/dma/st_fdma.c | |
parent | 0481291f0ccbc5147635cf0eb108f9fe5a05ee7d (diff) | |
download | linux-a67ba97dfb30486deb4661f770b954387acc898d.tar.xz |
dmaengine: 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/20231006213844.333027-1-robh@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/st_fdma.c')
-rw-r--r-- | drivers/dma/st_fdma.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c index 145bd0f2496e..8880b5e336f8 100644 --- a/drivers/dma/st_fdma.c +++ b/drivers/dma/st_fdma.c @@ -10,9 +10,10 @@ #include <linux/init.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/of_dma.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/interrupt.h> #include <linux/remoteproc.h> #include <linux/slab.h> @@ -739,18 +740,11 @@ static void st_fdma_free(struct st_fdma_dev *fdev) static int st_fdma_probe(struct platform_device *pdev) { struct st_fdma_dev *fdev; - const struct of_device_id *match; struct device_node *np = pdev->dev.of_node; const struct st_fdma_driverdata *drvdata; int ret, i; - match = of_match_device((st_fdma_match), &pdev->dev); - if (!match || !match->data) { - dev_err(&pdev->dev, "No device match found\n"); - return -ENODEV; - } - - drvdata = match->data; + drvdata = device_get_match_data(&pdev->dev); fdev = devm_kzalloc(&pdev->dev, sizeof(*fdev), GFP_KERNEL); if (!fdev) |