mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Fabio <fabio@redaril.me>
Cc: Fabio Forni <development@redaril.me>,
	Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC 3/3] ASoC: simple-card: Split alloc and init logics in probe function
Date: Tue, 20 Jan 2026 06:32:46 +0000	[thread overview]
Message-ID: <87a4y8rdyp.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <0a2a46e6-f1b2-4820-8d75-60b8f51cae66@redaril.me>


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

  reply	other threads:[~2026-01-20  6:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-12 23:12 [RFC 0/3] simple-card: Improve probe's error messages Fabio Forni
2026-01-12 23:12 ` [RFC 1/3] ASoC: simple-card: Do not print "parse error" twice Fabio Forni
2026-01-13  2:29   ` Kuninori Morimoto
2026-01-13  8:24     ` Fabio
2026-01-12 23:12 ` [RFC 2/3] ASoC: simple-card: Replace "parse error" with a more descriptive msg Fabio Forni
2026-01-12 23:12 ` [RFC 3/3] ASoC: simple-card: Split alloc and init logics in probe function Fabio Forni
2026-01-13  2:33   ` Kuninori Morimoto
2026-01-13 22:31     ` Fabio
2026-01-20  6:32       ` Kuninori Morimoto [this message]
2026-01-24 10:23         ` Fabio
2026-01-26  0:56           ` Kuninori Morimoto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a4y8rdyp.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=broonie@kernel.org \
    --cc=development@redaril.me \
    --cc=fabio@redaril.me \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®