diff options
author | Eugen Hristev | 2021-01-05 10:51:53 +0200 |
---|---|---|
committer | Eugen Hristev | 2021-01-22 15:09:59 +0200 |
commit | 864a4144ba30f405b8a8e136cffb8b3ef424058d (patch) | |
tree | b3bda2c11901b98cea318e53ba67df5f02893208 /drivers/pinctrl | |
parent | 63c27c3e66697db779ae4cd931f8ccfd84838ae5 (diff) |
pinctrl: at91-pio4: convert to dev_read_prop
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>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-at91-pio4.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c index 1aba8a91501..eff43380df8 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)); |