[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87a4y8rdyp.wl-kuninori.morimoto.gx@renesas.com>
Date: Tue, 20 Jan 2026 06:32:46 +0000
From: Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>
To: Fabio <fabio@...aril.me>
Cc: Fabio Forni <development@...aril.me>,
Mark Brown <broonie@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
linux-sound@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC 3/3] ASoC: simple-card: Split alloc and init logics in probe function
Hi Fabio
Sorry for my late response
> >> if (np && of_device_is_available(np)) {
> >> -
> >> ret = simple_parse_of(priv, li);
> >> if (ret < 0)
> >> - goto err;
> >> + dev_err_probe(dev, ret,
> >> + "components missing or uninitialized");
> >
> [snip]
> >
> > Is it clear error message ? It failed parse DT or something ?
>
> That's exactly the part that made me provide this patch. There's so much going
> on in simple_parse_of(). I think it may fail when a phandle of the wrong type
> is passed in any of the simple-card node.
> But I'm certain it can also fail when the DT is correct but kernel modules
> of the simple-card's components aren't loaded yet, since this very case happened
> to me. "components missing or uninitialized" basically sums it up, without saying
> "parse error" that suggests a purely syntactic error. If you don't agree with that
> message I can dive into the rabbit hole and learn what's going on inside simple_parse_of().
To be honest, I don't super mind about error message :P
But I have thought that the style like below can easy for people ?
(A) part checks something and return error, then indicate error reasons.
(B) part returns error because the called function returns error.
func () {
...
(A) if (...)
error("indicate error reason1")
(A) if (...)
error("indicate error reason2")
...
}
main() {
...
ret = func();
(B) if (ret < 0)
error("func() error")
...
}
Thank you for your help !!
Best regards
---
Kuninori Morimoto
Powered by blists - more mailing lists