aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2020-01-10 14:19:22 +0100
committerGeert Uytterhoeven <geert+renesas@glider.be>2020-02-21 13:57:44 +0100
commit40c8e4aad4e1575e101576aab1313f99ed3df49d (patch)
tree7a79b11c946989ff2e5ec2e8dcceae9aae7084be /drivers/pinctrl
parentpinctrl: sh-pfc: checker: Improve pin function checks (diff)
downloadwireguard-linux-40c8e4aad4e1575e101576aab1313f99ed3df49d.tar.xz
wireguard-linux-40c8e4aad4e1575e101576aab1313f99ed3df49d.zip
pinctrl: sh-pfc: checker: Improve pin group checks
Improve the checks for pin group descriptors: 1. Introduce a local variable for the current group, to make the checks easier to read, 2. Pin group names must be unique. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Link: https://lore.kernel.org/r/20200110131927.1029-9-geert+renesas@glider.be
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/sh-pfc/core.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index fd649ab8ad1a..b67584d65ecc 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -916,15 +916,22 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
}
for (i = 0; i < info->nr_groups; i++) {
- if (!info->groups[i].name) {
+ const struct sh_pfc_pin_group *group = &info->groups[i];
+
+ if (!group->name) {
sh_pfc_err("empty group %u\n", i);
continue;
}
+ for (j = 0; j < i; j++) {
+ if (same_name(group->name, info->groups[j].name))
+ sh_pfc_err("group %s: name conflict\n",
+ group->name);
+ }
if (!refcnts[i])
- sh_pfc_err("orphan group %s\n", info->groups[i].name);
+ sh_pfc_err("orphan group %s\n", group->name);
else if (refcnts[i] > 1)
sh_pfc_warn("group %s referenced by %u functions\n",
- info->groups[i].name, refcnts[i]);
+ group->name, refcnts[i]);
}
kfree(refcnts);