]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: pinmux: open-code PINCTRL_FUNCTION_DESC()
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 9 Jul 2025 14:38:57 +0000 (16:38 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sat, 19 Jul 2025 15:59:35 +0000 (17:59 +0200)
This macro is only used in one place and pin function descriptors should
only be created by pinmux core so there's no point in exposing it to
other pinctrl users. Remove the macro and hand-code its functionality.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/20250709-pinctrl-gpio-pinfuncs-v2-1-b6135149c0d9@linaro.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinmux.c
drivers/pinctrl/pinmux.h

index 2c31e7f2a27a86cb9d6d220aa901f8eb84b70a9e..a7865997ea14e31fa6d107ea2a2c38c31d91025d 100644 (file)
@@ -891,7 +891,8 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
        if (!function)
                return -ENOMEM;
 
-       *function = PINCTRL_FUNCTION_DESC(name, groups, ngroups, data);
+       function->func = PINCTRL_PINFUNCTION(name, groups, ngroups);
+       function->data = data;
 
        error = radix_tree_insert(&pctldev->pin_function_tree, selector, function);
        if (error)
index 2965ec20b77fb360ca244800e30f1eafa988a2b1..5c039fd09f7474b4c104d3c36e0e8b8dc73a2ddd 100644 (file)
@@ -141,13 +141,6 @@ struct function_desc {
        void *data;
 };
 
-/* Convenient macro to define a generic pin function descriptor */
-#define PINCTRL_FUNCTION_DESC(_name, _grps, _num_grps, _data)  \
-(struct function_desc) {                                       \
-       .func = PINCTRL_PINFUNCTION(_name, _grps, _num_grps),   \
-       .data = _data,                                          \
-}
-
 int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev);
 
 const char *