From: Thierry Reding <thierry.reding@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/12] gpio: 74xx-mmio: Use of_device_get_match_data()
Date: Mon, 30 Apr 2018 09:38:08 +0200 [thread overview]
Message-ID: <20180430073819.31827-1-thierry.reding@gmail.com> (raw)
From: Thierry Reding <treding@nvidia.com>
Use of_device_get_match_data() instead of open-coding it.
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
drivers/gpio/gpio-74xx-mmio.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c
index 0475e8ec96d0..49616ec815ee 100644
--- a/drivers/gpio/gpio-74xx-mmio.c
+++ b/drivers/gpio/gpio-74xx-mmio.c
@@ -105,27 +105,22 @@ static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
static int mmio_74xx_gpio_probe(struct platform_device *pdev)
{
- const struct of_device_id *of_id;
struct mmio_74xx_gpio_priv *priv;
struct resource *res;
void __iomem *dat;
int err;
- of_id = of_match_device(mmio_74xx_gpio_ids, &pdev->dev);
- if (!of_id)
- return -ENODEV;
-
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
+ priv->flags = (uintptr_t)of_device_get_match_data(&pdev->dev);
+
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dat = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dat))
return PTR_ERR(dat);
- priv->flags = (uintptr_t) of_id->data;
-
err = bgpio_init(&priv->gc, &pdev->dev,
DIV_ROUND_UP(MMIO_74XX_BIT_CNT(priv->flags), 8),
dat, NULL, NULL, NULL, NULL, 0);
--
2.17.0
next reply other threads:[~2018-04-30 7:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-30 7:38 Thierry Reding [this message]
2018-04-30 7:38 ` [PATCH 02/12] gpio: dwapb: Use of_device_get_match_data() Thierry Reding
2018-04-30 7:38 ` [PATCH 03/12] gpio: ge: " Thierry Reding
2018-04-30 7:38 ` [PATCH 04/12] gpio: ingenic: " Thierry Reding
2018-04-30 7:38 ` [PATCH 05/12] gpio: mxs: " Thierry Reding
2018-04-30 7:38 ` [PATCH 06/12] gpio: palmas: " Thierry Reding
2018-04-30 7:38 ` [PATCH 07/12] gpio: pca953x: " Thierry Reding
2018-04-30 7:38 ` [PATCH 08/12] gpio: pxa: " Thierry Reding
2018-04-30 7:38 ` [PATCH 09/12] gpio: syscon: " Thierry Reding
2018-04-30 7:38 ` [PATCH 10/12] gpio: ts4900: " Thierry Reding
2018-04-30 7:38 ` [PATCH 11/12] gpio: vf610: " Thierry Reding
2018-04-30 7:38 ` [PATCH 12/12] gpio: xlp: " Thierry Reding
2018-05-02 12:44 ` [PATCH 01/12] gpio: 74xx-mmio: " Linus Walleij
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=20180430073819.31827-1-thierry.reding@gmail.com \
--to=thierry.reding@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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).