Skip to content

Commit

Permalink
remoteproc: st: Use device_get_match_data()
Browse files Browse the repository at this point in the history
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>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Link: https://lore.kernel.org/r/20231009211356.3242037-10-robh@kernel.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
  • Loading branch information
Rob Herring authored and Mathieu Poirier committed Oct 11, 2023
1 parent 6013727 commit 5c77ebc
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/remoteproc/st_remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/remoteproc.h>
#include <linux/reset.h>
Expand Down Expand Up @@ -341,27 +340,22 @@ static int st_rproc_parse_dt(struct platform_device *pdev)
static int st_rproc_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
const struct of_device_id *match;
struct st_rproc *ddata;
struct device_node *np = dev->of_node;
struct rproc *rproc;
struct mbox_chan *chan;
int enabled;
int ret, i;

match = of_match_device(st_rproc_match, dev);
if (!match || !match->data) {
dev_err(dev, "No device match found\n");
return -ENODEV;
}

rproc = rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata));
if (!rproc)
return -ENOMEM;

rproc->has_iommu = false;
ddata = rproc->priv;
ddata->config = (struct st_rproc_config *)match->data;
ddata->config = (struct st_rproc_config *)device_get_match_data(dev);
if (!ddata->config)
goto free_rproc;

platform_set_drvdata(pdev, rproc);

Expand Down

0 comments on commit 5c77ebc

Please sign in to comment.