Skip to content

Commit 5c77ebc

Browse files
robherringmathieupoirier
authored andcommitted
remoteproc: st: 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 <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 6013727 commit 5c77ebc

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/remoteproc/st_remoteproc.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
#include <linux/mfd/syscon.h>
1717
#include <linux/module.h>
1818
#include <linux/of.h>
19-
#include <linux/of_address.h>
20-
#include <linux/of_device.h>
2119
#include <linux/of_reserved_mem.h>
2220
#include <linux/platform_device.h>
21+
#include <linux/property.h>
2322
#include <linux/regmap.h>
2423
#include <linux/remoteproc.h>
2524
#include <linux/reset.h>
@@ -341,27 +340,22 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
341340
static int st_rproc_probe(struct platform_device *pdev)
342341
{
343342
struct device *dev = &pdev->dev;
344-
const struct of_device_id *match;
345343
struct st_rproc *ddata;
346344
struct device_node *np = dev->of_node;
347345
struct rproc *rproc;
348346
struct mbox_chan *chan;
349347
int enabled;
350348
int ret, i;
351349

352-
match = of_match_device(st_rproc_match, dev);
353-
if (!match || !match->data) {
354-
dev_err(dev, "No device match found\n");
355-
return -ENODEV;
356-
}
357-
358350
rproc = rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata));
359351
if (!rproc)
360352
return -ENOMEM;
361353

362354
rproc->has_iommu = false;
363355
ddata = rproc->priv;
364-
ddata->config = (struct st_rproc_config *)match->data;
356+
ddata->config = (struct st_rproc_config *)device_get_match_data(dev);
357+
if (!ddata->config)
358+
goto free_rproc;
365359

366360
platform_set_drvdata(pdev, rproc);
367361

0 commit comments

Comments
 (0)