mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 02:15:57 +00:00
pinctrl: improve warning messages
Print out the affected group name on activation of pin mux settings, and warn if you cannot free a pin that should have been part of a certain setting. ChangeLog v1->v2: - Also print the pin name in the error messages. Cc: Sonic Zhang <sonic.zhang@analog.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
0a8d3e2412
commit
1c8e794432
@ -400,10 +400,14 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting)
|
|||||||
ret = pctlops->get_group_pins(pctldev, setting->data.mux.group,
|
ret = pctlops->get_group_pins(pctldev, setting->data.mux.group,
|
||||||
&pins, &num_pins);
|
&pins, &num_pins);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
const char *gname;
|
||||||
|
|
||||||
/* errors only affect debug data, so just warn */
|
/* errors only affect debug data, so just warn */
|
||||||
|
gname = pctlops->get_group_name(pctldev,
|
||||||
|
setting->data.mux.group);
|
||||||
dev_warn(pctldev->dev,
|
dev_warn(pctldev->dev,
|
||||||
"could not get pins for group selector %d\n",
|
"could not get pins for group %s\n",
|
||||||
setting->data.mux.group);
|
gname);
|
||||||
num_pins = 0;
|
num_pins = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,9 +415,18 @@ int pinmux_enable_setting(struct pinctrl_setting const *setting)
|
|||||||
for (i = 0; i < num_pins; i++) {
|
for (i = 0; i < num_pins; i++) {
|
||||||
ret = pin_request(pctldev, pins[i], setting->dev_name, NULL);
|
ret = pin_request(pctldev, pins[i], setting->dev_name, NULL);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
const char *gname;
|
||||||
|
const char *pname;
|
||||||
|
|
||||||
|
desc = pin_desc_get(pctldev, pins[i]);
|
||||||
|
pname = desc ? desc->name : "non-existing";
|
||||||
|
gname = pctlops->get_group_name(pctldev,
|
||||||
|
setting->data.mux.group);
|
||||||
dev_err(pctldev->dev,
|
dev_err(pctldev->dev,
|
||||||
"could not request pin %d on device %s\n",
|
"could not request pin %d (%s) from group %s "
|
||||||
pins[i], pinctrl_dev_get_name(pctldev));
|
" on device %s\n",
|
||||||
|
pins[i], pname, gname,
|
||||||
|
pinctrl_dev_get_name(pctldev));
|
||||||
goto err_pin_request;
|
goto err_pin_request;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -466,10 +479,14 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
|
|||||||
ret = pctlops->get_group_pins(pctldev, setting->data.mux.group,
|
ret = pctlops->get_group_pins(pctldev, setting->data.mux.group,
|
||||||
&pins, &num_pins);
|
&pins, &num_pins);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
const char *gname;
|
||||||
|
|
||||||
/* errors only affect debug data, so just warn */
|
/* errors only affect debug data, so just warn */
|
||||||
|
gname = pctlops->get_group_name(pctldev,
|
||||||
|
setting->data.mux.group);
|
||||||
dev_warn(pctldev->dev,
|
dev_warn(pctldev->dev,
|
||||||
"could not get pins for group selector %d\n",
|
"could not get pins for group %s\n",
|
||||||
setting->data.mux.group);
|
gname);
|
||||||
num_pins = 0;
|
num_pins = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,6 +503,18 @@ void pinmux_disable_setting(struct pinctrl_setting const *setting)
|
|||||||
desc->mux_setting = NULL;
|
desc->mux_setting = NULL;
|
||||||
/* And release the pin */
|
/* And release the pin */
|
||||||
pin_free(pctldev, pins[i], NULL);
|
pin_free(pctldev, pins[i], NULL);
|
||||||
|
} else {
|
||||||
|
const char *gname;
|
||||||
|
const char *pname;
|
||||||
|
|
||||||
|
pname = desc ? desc->name : "non-existing";
|
||||||
|
gname = pctlops->get_group_name(pctldev,
|
||||||
|
setting->data.mux.group);
|
||||||
|
dev_warn(pctldev->dev,
|
||||||
|
"not freeing pin %d (%s) as part of "
|
||||||
|
"deactivating group %s - it is already "
|
||||||
|
"used for some other setting",
|
||||||
|
pins[i], pname, gname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user