summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinmux.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-05-30 10:55:14 +0200
committerLinus Walleij <linus.walleij@linaro.org>2024-06-17 09:24:13 +0200
commitf26945d76a90f93a40e27238210bf0580cf8476f (patch)
tree7a13b085bd0ec6777d034a0d3a2765350397733f /drivers/pinctrl/pinmux.c
parentpinctrl: mediatek: moore: Provide a helper macro PINCTRL_PIN_FUNCTION() (diff)
downloadlinux-f26945d76a90f93a40e27238210bf0580cf8476f.tar.xz
linux-f26945d76a90f93a40e27238210bf0580cf8476f.zip
pinctrl: pinmux: Add a convenient define PINCTRL_FUNCTION_DESC()
Add PINCTRL_FUNCTION_DESC() macro for inline use. While at it, fix adjective form in the comment of PINCTRL_GROUP_DESC(). Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240530085745.1539925-6-andy.shevchenko@gmail.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinmux.c')
-rw-r--r--drivers/pinctrl/pinmux.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
index addba55334d9..8d69fa1b0bff 100644
--- a/drivers/pinctrl/pinmux.c
+++ b/drivers/pinctrl/pinmux.c
@@ -852,13 +852,13 @@ EXPORT_SYMBOL_GPL(pinmux_generic_get_function);
* @pctldev: pin controller device
* @name: name of the function
* @groups: array of pin groups
- * @num_groups: number of pin groups
+ * @ngroups: number of pin groups
* @data: pin controller driver specific data
*/
int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
const char *name,
const char * const *groups,
- const unsigned int num_groups,
+ const unsigned int ngroups,
void *data)
{
struct function_desc *function;
@@ -877,10 +877,7 @@ int pinmux_generic_add_function(struct pinctrl_dev *pctldev,
if (!function)
return -ENOMEM;
- function->name = name;
- function->group_names = groups;
- function->num_group_names = num_groups;
- function->data = data;
+ *function = PINCTRL_FUNCTION_DESC(name, groups, ngroups, data);
error = radix_tree_insert(&pctldev->pin_function_tree, selector, function);
if (error)