Skip to content

Commit a1cf1a5

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: mediatek: 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. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent ffc1945 commit a1cf1a5

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

drivers/pinctrl/mediatek/pinctrl-moore.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
5656
return -EINVAL;
5757

5858
dev_dbg(pctldev->dev, "enable function %s group %s\n",
59-
func->name, grp->name);
59+
func->name, grp->grp.name);
6060

61-
for (i = 0; i < grp->num_pins; i++) {
61+
for (i = 0; i < grp->grp.npins; i++) {
6262
const struct mtk_pin_desc *desc;
6363
int *pin_modes = grp->data;
64-
int pin = grp->pins[i];
64+
int pin = grp->grp.pins[i];
6565

6666
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
6767
if (!desc->name)
@@ -602,13 +602,12 @@ static int mtk_build_groups(struct mtk_pinctrl *hw)
602602

603603
for (i = 0; i < hw->soc->ngrps; i++) {
604604
const struct group_desc *group = hw->soc->grps + i;
605+
const struct pingroup *grp = &group->grp;
605606

606-
err = pinctrl_generic_add_group(hw->pctrl, group->name,
607-
group->pins, group->num_pins,
607+
err = pinctrl_generic_add_group(hw->pctrl, grp->name, grp->pins, grp->npins,
608608
group->data);
609609
if (err < 0) {
610-
dev_err(hw->dev, "Failed to register group %s\n",
611-
group->name);
610+
dev_err(hw->dev, "Failed to register group %s\n", grp->name);
612611
return err;
613612
}
614613
}

drivers/pinctrl/mediatek/pinctrl-moore.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939

4040
#define PINCTRL_PIN_GROUP(_name_, id) \
4141
{ \
42-
.name = _name_, \
43-
.pins = id##_pins, \
44-
.num_pins = ARRAY_SIZE(id##_pins), \
42+
.grp = PINCTRL_PINGROUP(_name_, id##_pins, ARRAY_SIZE(id##_pins)), \
4543
.data = id##_funcs, \
4644
}
4745

drivers/pinctrl/mediatek/pinctrl-paris.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151

5252
#define PINCTRL_PIN_GROUP(_name_, id) \
5353
{ \
54-
.name = _name_, \
55-
.pins = id##_pins, \
56-
.num_pins = ARRAY_SIZE(id##_pins), \
54+
.grp = PINCTRL_PINGROUP(_name_,id##_pins, ARRAY_SIZE(id##_pins)), \
5755
.data = id##_funcs, \
5856
}
5957

0 commit comments

Comments
 (0)