From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Rob Herring <robh@kernel.org>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>,
Bjorn Andersson <andersson@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remoteproc: st: Use device_get_match_data()
Date: Wed, 11 Oct 2023 11:46:14 -0600 [thread overview]
Message-ID: <ZSbfZuHHicFoMPAz@p14s> (raw)
In-Reply-To: <20231009211356.3242037-10-robh@kernel.org>
On Mon, Oct 09, 2023 at 04:13:40PM -0500, Rob Herring wrote:
> 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>
> ---
> drivers/remoteproc/st_remoteproc.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
Applied.
Thanks,
Mathieu
> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index e3ce01d98b4c..b0638f984842 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -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>
> @@ -341,7 +340,6 @@ 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;
> @@ -349,19 +347,15 @@ static int st_rproc_probe(struct platform_device *pdev)
> 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);
>
> --
> 2.42.0
>
WARNING: multiple messages have this Message-ID (diff)
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Rob Herring <robh@kernel.org>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>,
Bjorn Andersson <andersson@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] remoteproc: st: Use device_get_match_data()
Date: Wed, 11 Oct 2023 11:46:14 -0600 [thread overview]
Message-ID: <ZSbfZuHHicFoMPAz@p14s> (raw)
In-Reply-To: <20231009211356.3242037-10-robh@kernel.org>
On Mon, Oct 09, 2023 at 04:13:40PM -0500, Rob Herring wrote:
> 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>
> ---
> drivers/remoteproc/st_remoteproc.c | 14 ++++----------
> 1 file changed, 4 insertions(+), 10 deletions(-)
>
Applied.
Thanks,
Mathieu
> diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
> index e3ce01d98b4c..b0638f984842 100644
> --- a/drivers/remoteproc/st_remoteproc.c
> +++ b/drivers/remoteproc/st_remoteproc.c
> @@ -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>
> @@ -341,7 +340,6 @@ 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;
> @@ -349,19 +347,15 @@ static int st_rproc_probe(struct platform_device *pdev)
> 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);
>
> --
> 2.42.0
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-10-11 17:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-09 21:13 [PATCH] remoteproc: st: Use device_get_match_data() Rob Herring
2023-10-10 6:28 ` Patrice CHOTARD
2023-10-10 6:28 ` Patrice CHOTARD
2023-10-11 17:46 ` Mathieu Poirier [this message]
2023-10-11 17:46 ` Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZSbfZuHHicFoMPAz@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=patrice.chotard@foss.st.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.