This is an automatically generated commit. When doing `git bisect`, consider `git bisect --skip`. Signed-off-by: Kenneth Kasilag <kenneth@kasilag.me> Link: https://github.com/openwrt/openwrt/pull/21019 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
67 lines
2.2 KiB
Diff
67 lines
2.2 KiB
Diff
From 17d4f2a9e6cb224012d85fed52e9794a84fa501d Mon Sep 17 00:00:00 2001
|
|
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
|
Date: Tue, 2 Sep 2025 13:59:13 +0200
|
|
Subject: [PATCH 1/1] pinctrl: airoha: replace struct function_desc with struct
|
|
pinfunction
|
|
|
|
struct function_desc is a wrapper around struct pinfunction with an
|
|
additional void *data pointer. This driver doesn't use the data pointer.
|
|
We're also working towards reducing the usage of struct function_desc in
|
|
pinctrl drivers - they should only be created by pinmux core and
|
|
accessed by drivers using pinmux_generic_get_function(). Replace the
|
|
struct function_desc objects in this driver with smaller struct
|
|
pinfunction instances.
|
|
|
|
Tested-by: Neil Armstrong <neil.armstrong@linaro.org>
|
|
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
|
|
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
|
---
|
|
drivers/pinctrl/mediatek/pinctrl-airoha.c | 15 +++++----------
|
|
1 file changed, 5 insertions(+), 10 deletions(-)
|
|
|
|
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
|
|
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
|
|
@@ -35,13 +35,8 @@
|
|
|
|
#define PINCTRL_FUNC_DESC(id) \
|
|
{ \
|
|
- .desc = { \
|
|
- .func = { \
|
|
- .name = #id, \
|
|
- .groups = id##_groups, \
|
|
- .ngroups = ARRAY_SIZE(id##_groups), \
|
|
- } \
|
|
- }, \
|
|
+ .desc = PINCTRL_PINFUNCTION(#id, id##_groups, \
|
|
+ ARRAY_SIZE(id##_groups)), \
|
|
.groups = id##_func_group, \
|
|
.group_size = ARRAY_SIZE(id##_func_group), \
|
|
}
|
|
@@ -334,7 +329,7 @@ struct airoha_pinctrl_func_group {
|
|
};
|
|
|
|
struct airoha_pinctrl_func {
|
|
- const struct function_desc desc;
|
|
+ const struct pinfunction desc;
|
|
const struct airoha_pinctrl_func_group *groups;
|
|
u8 group_size;
|
|
};
|
|
@@ -2911,13 +2906,13 @@ static int airoha_pinctrl_probe(struct p
|
|
|
|
func = &airoha_pinctrl_funcs[i];
|
|
err = pinmux_generic_add_function(pinctrl->ctrl,
|
|
- func->desc.func.name,
|
|
- func->desc.func.groups,
|
|
- func->desc.func.ngroups,
|
|
+ func->desc.name,
|
|
+ func->desc.groups,
|
|
+ func->desc.ngroups,
|
|
(void *)func);
|
|
if (err < 0) {
|
|
dev_err(dev, "Failed to register function %s\n",
|
|
- func->desc.func.name);
|
|
+ func->desc.name);
|
|
return err;
|
|
}
|
|
}
|