From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Richard Weinberger <richard@nod.at>,
David Woodhouse <dwmw2@infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
Marek Vasut <marek.vasut@gmail.com>,
Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
linux-mtd@lists.infradead.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] mtd: nand: sh_flctl: Use of_device_get_match_data() helper
Date: Thu, 5 Oct 2017 09:24:42 +0200 [thread overview]
Message-ID: <20171005092442.5126afcb@bbrezillon> (raw)
In-Reply-To: <1507119543-12723-1-git-send-email-geert+renesas@glider.be>
On Wed, 4 Oct 2017 14:19:03 +0200
Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Use the of_device_get_match_data() helper instead of open coding.
> While at it, make config const so the cast can be dropped.
>
Applied.
Thanks,
Boris
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/mtd/nand/sh_flctl.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index e7f3c98487e620bc..3c5008a4f5f33acc 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -1094,14 +1094,11 @@ MODULE_DEVICE_TABLE(of, of_flctl_match);
>
> static struct sh_flctl_platform_data *flctl_parse_dt(struct device *dev)
> {
> - const struct of_device_id *match;
> - struct flctl_soc_config *config;
> + const struct flctl_soc_config *config;
> struct sh_flctl_platform_data *pdata;
>
> - match = of_match_device(of_flctl_match, dev);
> - if (match)
> - config = (struct flctl_soc_config *)match->data;
> - else {
> + config = of_device_get_match_data(dev);
> + if (!config) {
> dev_err(dev, "%s: no OF configuration attached\n", __func__);
> return NULL;
> }
prev parent reply other threads:[~2017-10-05 7:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-04 12:19 [PATCH] mtd: nand: sh_flctl: Use of_device_get_match_data() helper Geert Uytterhoeven
2017-10-05 7:24 ` Boris Brezillon [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=20171005092442.5126afcb@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=cyrille.pitchen@wedev4u.fr \
--cc=dwmw2@infradead.org \
--cc=geert+renesas@glider.be \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
/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).