[PATCH 12/17] pinctrl: max77620: Move fixed assignments to 'pinctrl_desc' definition
Krzysztof Kozlowski
krzysztof.kozlowski at linaro.org
Wed May 28 20:41:08 AEST 2025
Assign 'struct pinctrl_desc' .pins, .npins and other members in
definition to make clear that number of pins is fixed and have less code
in the probe.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski at linaro.org>
---
drivers/pinctrl/pinctrl-max77620.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-max77620.c b/drivers/pinctrl/pinctrl-max77620.c
index d236daa7c13ebbcaf7c4a8d1a8bed751aa111c0f..acb945a2574368b2e34659a902c34df8aad193d7 100644
--- a/drivers/pinctrl/pinctrl-max77620.c
+++ b/drivers/pinctrl/pinctrl-max77620.c
@@ -543,6 +543,10 @@ static struct pinctrl_desc max77620_pinctrl_desc = {
.pctlops = &max77620_pinctrl_ops,
.pmxops = &max77620_pinmux_ops,
.confops = &max77620_pinconf_ops,
+ .pins = max77620_pins_desc,
+ .npins = ARRAY_SIZE(max77620_pins_desc),
+ .num_custom_params = ARRAY_SIZE(max77620_cfg_params),
+ .custom_params = max77620_cfg_params,
};
static int max77620_pinctrl_probe(struct platform_device *pdev)
@@ -569,11 +573,6 @@ static int max77620_pinctrl_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mpci);
max77620_pinctrl_desc.name = dev_name(&pdev->dev);
- max77620_pinctrl_desc.pins = max77620_pins_desc;
- max77620_pinctrl_desc.npins = ARRAY_SIZE(max77620_pins_desc);
- max77620_pinctrl_desc.num_custom_params =
- ARRAY_SIZE(max77620_cfg_params);
- max77620_pinctrl_desc.custom_params = max77620_cfg_params;
for (i = 0; i < MAX77620_PIN_NUM; ++i) {
mpci->fps_config[i].active_fps_src = -1;
--
2.45.2
More information about the Linux-aspeed
mailing list