From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Haojian Zhuang <haojian.zhuang@linaro.org>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Nishanth Menon <nm@ti.com>,
linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org
Subject: [PATCH 2/2] pinctrl: single: Drop pointless macro
Date: Tue, 25 Oct 2016 09:09:00 -0700 [thread overview]
Message-ID: <20161025160900.2724-3-tony@atomide.com> (raw)
In-Reply-To: <20161025160900.2724-1-tony@atomide.com>
This is left over from initial experiments with more properties.
It's only used in one place, so let's just get rid of it to make
the code more readable.
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
drivers/pinctrl/pinctrl-single.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -1471,15 +1471,6 @@ static void pcs_free_resources(struct pcs_device *pcs)
pcs_free_pingroups(pcs);
}
-#define PCS_GET_PROP_U32(name, reg, err) \
- do { \
- ret = of_property_read_u32(np, name, reg); \
- if (ret) { \
- dev_err(pcs->dev, err); \
- return ret; \
- } \
- } while (0);
-
static const struct of_device_id pcs_of_match[];
static int pcs_add_gpio_func(struct device_node *node, struct pcs_device *pcs)
@@ -1824,8 +1815,13 @@ static int pcs_probe(struct platform_device *pdev)
pcs->flags = soc->flags;
memcpy(&pcs->socdata, soc, sizeof(*soc));
- PCS_GET_PROP_U32("pinctrl-single,register-width", &pcs->width,
- "register width not specified\n");
+ ret = of_property_read_u32(np, "pinctrl-single,register-width",
+ &pcs->width);
+ if (ret) {
+ dev_err(pcs->dev, "register width not specified\n");
+
+ return ret;
+ }
ret = of_property_read_u32(np, "pinctrl-single,function-mask",
&pcs->fmask);
--
2.9.3
next prev parent reply other threads:[~2016-10-25 16:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-25 16:08 [PATCH 0/2] Few pinctrl-single clean-ups Tony Lindgren
2016-10-25 16:08 ` [PATCH 1/2] pinctrl: single: Drop custom names Tony Lindgren
2016-10-26 14:17 ` Tony Lindgren
2016-10-27 14:59 ` Tony Lindgren
2016-10-25 16:09 ` Tony Lindgren [this message]
2016-10-28 11:54 ` [PATCH 2/2] pinctrl: single: Drop pointless macro Linus Walleij
2016-10-27 8:16 ` [PATCH 0/2] Few pinctrl-single clean-ups Linus Walleij
2016-10-27 15:00 ` Tony Lindgren
2016-10-27 20:15 ` Linus Walleij
2016-10-27 21:19 ` Tony Lindgren
2016-10-28 11:53 ` Linus Walleij
2016-10-28 12:52 ` Tony Lindgren
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=20161025160900.2724-3-tony@atomide.com \
--to=tony@atomide.com \
--cc=grygorii.strashko@ti.com \
--cc=haojian.zhuang@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=nm@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).