Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: max77620: Move fixed assignments to 'pinctrl_desc' definition

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@linaro.org>
Link: https://lore.kernel.org/20250611-pinctrl-const-desc-v2-12-b11c1d650384@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Krzysztof Kozlowski and committed by
Linus Walleij
ed32213f 1bd634e5

+4 -5
+4 -5
drivers/pinctrl/pinctrl-max77620.c
··· 543 543 .pctlops = &max77620_pinctrl_ops, 544 544 .pmxops = &max77620_pinmux_ops, 545 545 .confops = &max77620_pinconf_ops, 546 + .pins = max77620_pins_desc, 547 + .npins = ARRAY_SIZE(max77620_pins_desc), 548 + .num_custom_params = ARRAY_SIZE(max77620_cfg_params), 549 + .custom_params = max77620_cfg_params, 546 550 }; 547 551 548 552 static int max77620_pinctrl_probe(struct platform_device *pdev) ··· 573 569 platform_set_drvdata(pdev, mpci); 574 570 575 571 max77620_pinctrl_desc.name = dev_name(&pdev->dev); 576 - max77620_pinctrl_desc.pins = max77620_pins_desc; 577 - max77620_pinctrl_desc.npins = ARRAY_SIZE(max77620_pins_desc); 578 - max77620_pinctrl_desc.num_custom_params = 579 - ARRAY_SIZE(max77620_cfg_params); 580 - max77620_pinctrl_desc.custom_params = max77620_cfg_params; 581 572 582 573 for (i = 0; i < MAX77620_PIN_NUM; ++i) { 583 574 mpci->fps_config[i].active_fps_src = -1;