pinctrl: rockchip: improve error message for incorrect rockchip,pins property
Subsystems (3)
PATCH 1/1 pinctrl: rockchip: improve error message for incorrect rockchip,pins property
From: Quentin Schulz <[email protected]>
If one improperly writes a rockchip,pins property, the pinctrl driver basically just states that one in the myriad of pinctrl nodes is improper but does not tell you which one.
Instead, let's print the full name of the Device Tree node that is improper as well as provide more context on what the expected content is.
Note that this should be rather unnecessary if one reads the output of the dtbs_check as it would be highlighted as an error.
--- drivers/pinctrl/pinctrl-rockchip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-rockchip.c +3 -1
@@ -3227,7 +3227,9 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,/* we do not check return since it's safe node passed down */ size /=sizeof (*list);if (!size || size %4 ) -return dev_err_probe (dev, -EINVAL ,"wrong pins number or pins and configs should be by 4\n" ); +return dev_err_probe (dev, -EINVAL , +"%pOF: rockchip,pins: expected one or more of <bank pin mux CONFIG>, got %d args instead\n" , + np, size); grp->npins = size /4 ;
---
base-commit: e32cde8d2bd7d251a8f9b434143977ddf13dcec6
change-id: 20241002-pinctrl-rockchip-error-modulo-4-8fb1affc063a
Best regards,
Signature · 1 line
Quentin Schulz <[email protected]>
Am Mittwoch, 2. Oktober 2024, 14:03:03 CEST schrieb Quentin Schulz:
Quoted 6 lines
From: Quentin Schulz <[email protected]>
If one improperly writes a rockchip,pins property, the pinctrl driver basically just states that one in the myriad of pinctrl nodes is improper but does not tell you which one.
Quoted 6 lines
Instead, let's print the full name of the Device Tree node that is improper as well as provide more context on what the expected content is.
Note that this should be rather unnecessary if one reads the output of the
dtbs_checkas it would be highlighted as an error.
Nevertheless, having a more helpful error message in the case this happens is still nice to have
Quoted 27 lines
Signed-off-by Quentin Schulz <[email protected]>--- drivers/pinctrl/pinctrl-rockchip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pinctrl/pinctrl-rockchip.c +3
-2@@ -3227,7 +3227,9 @@ static int rockchip_pinctrl_parse_groups(struct device_node *np,/* we do not check return since it's safe node passed down */ size /=sizeof (*list);if (!size || size %4 ) -return dev_err_probe (dev, -EINVAL ,"wrong pins number or pins and configs should be by 4\n" ); +return dev_err_probe (dev, -EINVAL , +"%pOF: rockchip,pins: expected one or more of <bank pin mux CONFIG>, got %d args instead\n" , + np, size); grp->npins = size /4 ; ---base-commit:
e32cde8d2bd7d251a8f9b434143977ddf13dcec6
change-id: 20241002-pinctrl-rockchip-error-modulo-4-8fb1affc063aBest regards,
Quoted 6 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
If one improperly writes a rockchip,pins property, the pinctrl driver basically just states that one in the myriad of pinctrl nodes is improper but does not tell you which one.
Quoted 8 lines
Instead, let's print the full name of the Device Tree node that is improper as well as provide more context on what the expected content is.
Note that this should be rather unnecessary if one reads the output of the
dtbs_checkas it would be highlighted as an error.Signed-off-by Quentin Schulz <[email protected]>
Patch applied!
2 hours! Record time!
But Heiko was there to ACK it so why not :)
Yours,
Linus Walleij