From: Dan Carpenter <dan.carpenter@linaro.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Kate Hsuan <hpa@redhat.com>, Lee Jones <lee@kernel.org>,
Pavel Machek <pavel@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Hans de Goede <hansg@kernel.org>,
Andy Shevchenko <andy@kernel.org>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] leds: rgb: leds-ktd202x: Fix error code in ktd202x_setup_led_rgb()
Date: Tue, 9 Dec 2025 17:41:27 +0300 [thread overview]
Message-ID: <aTg1F1MH5qnmUkaG@stanley.mountain> (raw)
In-Reply-To: <CAHp75VdHEVsj9o1UPSS1ikJYofDuiA7KwUaj8v79cJ3Xs=N5xw@mail.gmail.com>
On Tue, Dec 09, 2025 at 04:14:03PM +0200, Andy Shevchenko wrote:
> On Tue, Dec 9, 2025 at 8:56 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
> >
> > Return -EINVAL if the "reg" value is invalid. This is unlikely to
> > happen in real life because it comes from the firmware, whether from
> > device tree or ACPI.
>
> ...
>
> > if (ret != 0 || reg >= chip->num_leds) {
> > dev_err(chip->dev, "invalid 'reg' of %pfw\n", child);
> > fwnode_handle_put(child);
> > - return ret;
> > + return ret ?: -EINVAL;
> > }
>
> I think the better fix is to split the original conditional to two.
>
> And make the message something like
> "can't retrieve 'reg' property of %pfw\n'
> for the case if (ret).
>
These are never going to show up for users, the messages are only for
developers bringing up a board...
regards,
dan carpenter
next prev parent reply other threads:[~2025-12-09 14:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-09 6:56 [PATCH] leds: rgb: leds-ktd202x: Fix error code in ktd202x_setup_led_rgb() Dan Carpenter
2025-12-09 14:14 ` Andy Shevchenko
2025-12-09 14:41 ` Dan Carpenter [this message]
2025-12-09 14:44 ` Andy Shevchenko
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=aTg1F1MH5qnmUkaG@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=hansg@kernel.org \
--cc=hpa@redhat.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@kernel.org \
--cc=sakari.ailus@linux.intel.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