devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Agner <stefan@agner.ch>
To: linus.walleij@linaro.org, shawnguo@kernel.org, kernel@pengutronix.de
Cc: aisheng.dong@nxp.com, mark.rutland@arm.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Stefan Agner <stefan@agner.ch>,
	robh+dt@kernel.org, fabio.estevam@nxp.com,
	Arvind Yadav <arvind.yadav.cs@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] pinctrl: imx7d: simplify imx7d_pinctrl_probe
Date: Sat,  6 Jan 2018 15:25:50 +0100	[thread overview]
Message-ID: <20180106142553.15322-3-stefan@agner.ch> (raw)
In-Reply-To: <20180106142553.15322-1-stefan@agner.ch>

Using of_device_get_match_data in imx7d_pinctrl_probe simplifies
the function. Also get rid of the void pointer cast since
imx_pinctrl_probe now accepts const struct imx_pinctrl_soc_info.

Cc: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 drivers/pinctrl/freescale/pinctrl-imx7d.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx7d.c b/drivers/pinctrl/freescale/pinctrl-imx7d.c
index 754159ee7b1e..0b0a2f33b06a 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx7d.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx7d.c
@@ -378,16 +378,12 @@ static const struct of_device_id imx7d_pinctrl_of_match[] = {
 
 static int imx7d_pinctrl_probe(struct platform_device *pdev)
 {
-	const struct of_device_id *match;
-	struct imx_pinctrl_soc_info *pinctrl_info;
+	const struct imx_pinctrl_soc_info *pinctrl_info;
 
-	match = of_match_device(imx7d_pinctrl_of_match, &pdev->dev);
-
-	if (!match)
+	pinctrl_info = of_device_get_match_data(&pdev->dev);
+	if (!pinctrl_info)
 		return -ENODEV;
 
-	pinctrl_info = (struct imx_pinctrl_soc_info *) match->data;
-
 	return imx_pinctrl_probe(pdev, pinctrl_info);
 }
 
-- 
2.15.1

  parent reply	other threads:[~2018-01-06 14:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-06 14:25 [PATCH v2 0/5] constify struct imx_pinctrl_soc_info Stefan Agner
2018-01-06 14:25 ` [PATCH v2 1/5] pinctrl: imx: use struct imx_pinctrl_soc_info as a const Stefan Agner
2018-01-08 16:48   ` Gary Bisson
     [not found]     ` <20180108164855.GA6504-gtbVdJvtf7D/PtFMR13I2A@public.gmane.org>
2018-01-08 20:52       ` Stefan Agner
2018-01-09 14:33         ` Gary Bisson
     [not found]   ` <20180106142553.15322-2-stefan-XLVq0VzYD2Y@public.gmane.org>
2018-01-11  9:24     ` Linus Walleij
2018-01-06 14:25 ` Stefan Agner [this message]
2018-01-11  9:25   ` [PATCH v2 2/5] pinctrl: imx7d: simplify imx7d_pinctrl_probe Linus Walleij
     [not found] ` <20180106142553.15322-1-stefan-XLVq0VzYD2Y@public.gmane.org>
2018-01-06 14:25   ` [PATCH v2 3/5] pinctrl: imx: constify struct imx_pinctrl_soc_info Stefan Agner
2018-01-11  9:26     ` Linus Walleij
2018-01-06 14:25 ` [PATCH v2 4/5] pinctrl: imx7ulp: constify struct imx_cfg_params_decode Stefan Agner
2018-01-11  9:27   ` Linus Walleij
2018-01-06 14:25 ` [PATCH v2 5/5] pinctrl: imx6ul: add IOMUXC SNVS pinctrl driver for i.MX 6ULL Stefan Agner
2018-01-09 14:07   ` Linus Walleij
2018-01-09 14:11     ` Fabio Estevam
     [not found]       ` <CAOMZO5CjCv1Lg6sazyJWS_xZvD6bXhW=1poYMEFUbgodAST5Yg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-09 14:33         ` Linus Walleij
     [not found]     ` <CACRpkdYJcS3Ng=uR-iPgJ22ABfbiVENjWGsaWwShUfbg1hU4+g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-10  5:35       ` A.s. Dong
2018-01-08 10:32 ` [PATCH v2 0/5] constify struct imx_pinctrl_soc_info Dong Aisheng

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=20180106142553.15322-3-stefan@agner.ch \
    --to=stefan@agner.ch \
    --cc=aisheng.dong@nxp.com \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=fabio.estevam@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@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 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).