* [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property
@ 2024-10-02 12:03 Quentin Schulz
2024-10-02 13:24 ` Heiko Stübner
2024-10-02 14:12 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Quentin Schulz @ 2024-10-02 12:03 UTC (permalink / raw)
To: Linus Walleij, Heiko Stuebner
Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
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.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
drivers/pinctrl/pinctrl-rockchip.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 5c1bc4d5b662ed403ea5c8e57a8e1cad913a31a5..04e85a6037c93f415670b286f91fccada0d38fbf 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -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,
--
Quentin Schulz <quentin.schulz@cherry.de>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property
2024-10-02 12:03 [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property Quentin Schulz
@ 2024-10-02 13:24 ` Heiko Stübner
2024-10-02 14:12 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2024-10-02 13:24 UTC (permalink / raw)
To: Linus Walleij, Quentin Schulz
Cc: linux-gpio, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
Am Mittwoch, 2. Oktober 2024, 14:03:03 CEST schrieb Quentin Schulz:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> 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.
Nevertheless, having a more helpful error message in the case this
happens is still nice to have
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
> drivers/pinctrl/pinctrl-rockchip.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 5c1bc4d5b662ed403ea5c8e57a8e1cad913a31a5..04e85a6037c93f415670b286f91fccada0d38fbf 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -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,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property
2024-10-02 12:03 [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property Quentin Schulz
2024-10-02 13:24 ` Heiko Stübner
@ 2024-10-02 14:12 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2024-10-02 14:12 UTC (permalink / raw)
To: Quentin Schulz
Cc: Heiko Stuebner, linux-gpio, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz
On Wed, Oct 2, 2024 at 2:03 PM Quentin Schulz <foss+kernel@0leil.net> wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> 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.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Patch applied!
2 hours! Record time!
But Heiko was there to ACK it so why not :)
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-02 14:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-02 12:03 [PATCH] pinctrl: rockchip: improve error message for incorrect rockchip,pins property Quentin Schulz
2024-10-02 13:24 ` Heiko Stübner
2024-10-02 14:12 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox