From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Suman Anna <s-anna@ti.com>, Santosh Shilimkar <ssantosh@kernel.org>
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] soc: ti: k3-ringacc: Use of_device_get_match_data()
Date: Fri, 5 Feb 2021 13:24:01 +0200 [thread overview]
Message-ID: <7340caba-6975-2bc3-021e-c54a67cbcd18@ti.com> (raw)
In-Reply-To: <20210130050400.28085-1-s-anna@ti.com>
On 30/01/2021 07:04, Suman Anna wrote:
> Simplify the retrieval of getting the match data in the probe
> function by directly using of_device_get_match_data() instead
> of using of_match_node() and getting data.
>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> ---
> drivers/soc/ti/k3-ringacc.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
> index b495b0d5d0fa..312ba0f98ad7 100644
> --- a/drivers/soc/ti/k3-ringacc.c
> +++ b/drivers/soc/ti/k3-ringacc.c
> @@ -9,6 +9,7 @@
> #include <linux/io.h>
> #include <linux/init.h>
> #include <linux/of.h>
> +#include <linux/of_device.h>
> #include <linux/platform_device.h>
> #include <linux/sys_soc.h>
> #include <linux/dma/ti-cppi5.h>
> @@ -1517,15 +1518,13 @@ EXPORT_SYMBOL_GPL(k3_ringacc_dmarings_init);
> static int k3_ringacc_probe(struct platform_device *pdev)
> {
> const struct ringacc_match_data *match_data;
> - const struct of_device_id *match;
> struct device *dev = &pdev->dev;
> struct k3_ringacc *ringacc;
> int ret;
>
> - match = of_match_node(k3_ringacc_of_match, dev->of_node);
> - if (!match)
> + match_data = of_device_get_match_data(&pdev->dev);
> + if (!match_data)
> return -ENODEV;
> - match_data = match->data;
>
> ringacc = devm_kzalloc(dev, sizeof(*ringacc), GFP_KERNEL);
> if (!ringacc)
>
Thank you
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
--
Best regards,
grygorii
prev parent reply other threads:[~2021-02-05 11:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-30 5:04 [PATCH] soc: ti: k3-ringacc: Use of_device_get_match_data() Suman Anna
2021-02-05 11:24 ` Grygorii Strashko [this message]
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=7340caba-6975-2bc3-021e-c54a67cbcd18@ti.com \
--to=grygorii.strashko@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=s-anna@ti.com \
--cc=ssantosh@kernel.org \
--cc=vigneshr@ti.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).