Skip to content

Commit dd47155

Browse files
Bartosz GolaszewskiLinus Walleij
authored andcommitted
pinctrl: pinmux: open-code PINCTRL_FUNCTION_DESC()
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>
1 parent 6314954 commit dd47155

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

drivers/pinctrl/pinmux.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,8 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
891891
if (!function)
892892
return -ENOMEM;
893893

894-
*function = PINCTRL_FUNCTION_DESC(name, groups, ngroups, data);
894+
function->func = PINCTRL_PINFUNCTION(name, groups, ngroups);
895+
function->data = data;
895896

896897
error = radix_tree_insert(&pctldev->pin_function_tree, selector, function);
897898
if (error)

drivers/pinctrl/pinmux.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ struct function_desc {
141141
void *data;
142142
};
143143

144-
/* Convenient macro to define a generic pin function descriptor */
145-
#define PINCTRL_FUNCTION_DESC(_name, _grps, _num_grps, _data) \
146-
(struct function_desc) { \
147-
.func = PINCTRL_PINFUNCTION(_name, _grps, _num_grps), \
148-
.data = _data, \
149-
}
150-
151144
int pinmux_generic_get_function_count(struct pinctrl_dev *pctldev);
152145

153146
const char *

0 commit comments

Comments
 (0)