Hi Krzysztof,
>
> On 28/08/2025 10:32, Gary Yang wrote:
> > Hi Krzysztof,
> >
> >>
> >> On 28/08/2025 08:44, Gary Yang wrote:
> >>>>
> >>>>> + if (ret) {
> >>>>> + dev_err(&pdev->dev, "fail to probe dt
> >>>>> + properties\n");
> >>>>
> >>>> You are printing same error twice. Drop this and just handle error
> >>>> printing in sky1_pinctrl_probe_dt().
> >>>> Especially that you now print errors on ENOMEM.
> >>>>
> >>>
> >>> Sorry, this print message is only once, not twice, please give more
> >>> information
> >>
> >> Trigger the error and check how many error messages you see. I see two.
> >> You should know your code better than me...
> >>
> >
> > There are two pin-controller on sky1. They share the same driver. The probe
> is called twice.
> >
> > So we see the print message twice.
>
>
> No, you don't really understand how this works. Test your code and its error
> paths and you will see FOR ONE BIND more than one error message.
> Plus my second comment which you completely ignored.
>
> I am sorry, but this is basic C.
>
In order to trigger a error, we add a sentence in sky1_pinctrl_probe_dt() as follow:
static int sky1_pinctrl_probe_dt(struct platform_device *pdev,
struct sky1_pinctrl *spctl)
{
+ return -ENODEV;
.......
}
dmesg shows as following:
[ 0.812780] /soc@0/pinctrl@4170000: Fixed dependency cycle(s) with /soc@0/pinctrl@4170000/hog-pins
[ 0.821920] sky1-pinctrl 4170000.pinctrl: fail to probe dt properties
[ 0.828503] /soc@0/pinctrl@16007000: Fixed dependency cycle(s) with /soc@0/pinctrl@16007000/hog-s5-pins
[ 0.838058] sky1-pinctrl 16007000.pinctrl: fail to probe dt properties
I don't see the error message twice per one. There are two pin-controller. One is /soc@0/pinctrl@4170000. Other is /soc@0/pinctrl@16007000.
So you see the twice, once per one pin-controller. BTW as you suggested before, we will print the value of ret in the error message.
If I miss any information, please kindly remind me. Thanks
> Best regards,
> Krzysztof
Best wishes
Gary