Skip to content

Commit 10ce59c

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: ingenic: Convert to use grp member
Convert drivers to use grp member embedded in struct group_desc, because other members will be removed to avoid duplication and desynchronisation of the generic pin group description. Acked-by: Paul Cercueil <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 390270f commit 10ce59c

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

drivers/pinctrl/pinctrl-ingenic.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,13 @@
8484

8585
#define INGENIC_PIN_GROUP_FUNCS(_name_, id, funcs) \
8686
{ \
87-
.name = _name_, \
88-
.pins = id##_pins, \
89-
.num_pins = ARRAY_SIZE(id##_pins), \
87+
.grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \
9088
.data = funcs, \
9189
}
9290

9391
#define INGENIC_PIN_GROUP(_name_, id, func) \
9492
{ \
95-
.name = _name_, \
96-
.pins = id##_pins, \
97-
.num_pins = ARRAY_SIZE(id##_pins), \
93+
.grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \
9894
.data = (void *)func, \
9995
}
10096

@@ -3766,17 +3762,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
37663762
return -EINVAL;
37673763

37683764
dev_dbg(pctldev->dev, "enable function %s group %s\n",
3769-
func->name, grp->name);
3765+
func->name, grp->grp.name);
37703766

37713767
mode = (uintptr_t)grp->data;
37723768
if (mode <= 3) {
3773-
for (i = 0; i < grp->num_pins; i++)
3774-
ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], mode);
3769+
for (i = 0; i < grp->grp.npins; i++)
3770+
ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], mode);
37753771
} else {
37763772
pin_modes = grp->data;
37773773

3778-
for (i = 0; i < grp->num_pins; i++)
3779-
ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], pin_modes[i]);
3774+
for (i = 0; i < grp->grp.npins; i++)
3775+
ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], pin_modes[i]);
37803776
}
37813777

37823778
return 0;
@@ -4303,12 +4299,12 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
43034299

43044300
for (i = 0; i < chip_info->num_groups; i++) {
43054301
const struct group_desc *group = &chip_info->groups[i];
4302+
const struct pingroup *grp = &group->grp;
43064303

4307-
err = pinctrl_generic_add_group(jzpc->pctl, group->name,
4308-
group->pins, group->num_pins, group->data);
4304+
err = pinctrl_generic_add_group(jzpc->pctl, grp->name, grp->pins, grp->npins,
4305+
group->data);
43094306
if (err < 0) {
4310-
dev_err(dev, "Failed to register group %s\n",
4311-
group->name);
4307+
dev_err(dev, "Failed to register group %s\n", grp->name);
43124308
return err;
43134309
}
43144310
}

0 commit comments

Comments
 (0)