Skip to content

Commit dd47155

Browse files
Bartosz Golaszewskilinusw
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 <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 6314954 commit dd47155

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

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)