From: Eugen Hristev <eugen.hristev@microchip.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/4] pinctrl: at91-pio4: convert to dev_read_prop
Date: Thu, 7 Jan 2021 09:20:46 +0200 [thread overview]
Message-ID: <20210107072047.150507-3-eugen.hristev@microchip.com> (raw)
In-Reply-To: <20210107072047.150507-1-eugen.hristev@microchip.com>
Use dev_read_prop instead of using the fdt_read_property which
reads from the GD struct's fdt.
This way the node is accessed via the device config instead of the
global struct, which makes code more portable and GD independent.
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
drivers/pinctrl/pinctrl-at91-pio4.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index bf85cc916a..58f4d8cb39 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -36,7 +36,7 @@ static const struct pinconf_param conf_params[] = {
{ "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 },
};
-static u32 atmel_pinctrl_get_pinconf(const void *blob, int node)
+static u32 atmel_pinctrl_get_pinconf(struct udevice *config)
{
const struct pinconf_param *params;
u32 param, arg, conf = 0;
@@ -44,7 +44,7 @@ static u32 atmel_pinctrl_get_pinconf(const void *blob, int node)
for (i = 0; i < ARRAY_SIZE(conf_params); i++) {
params = &conf_params[i];
- if (!fdt_get_property(blob, node, params->property, NULL))
+ if (!dev_read_prop(config, params->property, NULL))
continue;
param = params->param;
@@ -115,7 +115,7 @@ static int atmel_pinctrl_set_state(struct udevice *dev, struct udevice *config)
u32 i, conf;
int count;
- conf = atmel_pinctrl_get_pinconf(blob, node);
+ conf = atmel_pinctrl_get_pinconf(config);
count = fdtdec_get_int_array_count(blob, node, "pinmux",
cells, ARRAY_SIZE(cells));
--
2.25.1
next prev parent reply other threads:[~2021-01-07 7:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 7:20 [PATCH 1/4] dt-bindings: pinctrl: at91-pio4: update license to SPDX style Eugen Hristev
2021-01-07 7:20 ` [PATCH 2/4] dt-bindings: pinctrl: at91-pio4: add property for drive strength Eugen Hristev
2021-01-07 7:20 ` Eugen Hristev [this message]
2021-01-07 7:20 ` [PATCH 4/4] pinctrl: at91-pio4: implement drive strength support Eugen Hristev
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=20210107072047.150507-3-eugen.hristev@microchip.com \
--to=eugen.hristev@microchip.com \
--cc=u-boot@lists.denx.de \
/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