From: Alexander Shiyan <eagle.alexander923@gmail.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] clk: Fix return value of of_clk_get_by_name()
Date: Fri, 6 Oct 2023 13:00:05 +0300 [thread overview]
Message-ID: <CAP1tNvQS9A-+B4NCVQ75ct+ZqUaskRkqzBLBrg+cyB5YeSqOSg@mail.gmail.com> (raw)
In-Reply-To: <bebb4782-d1cb-e870-6837-7b00133193ca@pengutronix.de>
> On 06.10.23 07:28, Alexander Shiyan wrote:
> > of_clk_get_by_name() is used by clk_bulk_get_optional() => clk_get() function,
> > so in case some clocks are missing we should return -ENOENT error code,
> > as this is normal for optional clocks.
> > The current implementation of of_clk_get_by_name() returns the -EINVAL error
> > that comes from of_clk_get() with index <0 if the clock is not described
> > in the device tree.
>
> I stumbled upon the same problem and found that of_clk_get_by_name() returning
> ERR_PTR(-EINVAL) in this case is documented Linux behavior (for of_parse_clkspec()).
>
> The correct solution is thus to leave of_clk_get_by_name() alone and align
> clk_get return values with Linux.
>
> I did this in
> https://lore.barebox.org/barebox/20230921080236.GX637806@pengutronix.de/T/#t
>
> Can you test with that and see if it solves your issue?
Hello Ahmad.
Yes, this patch works. Thanks!
prev parent reply other threads:[~2023-10-06 10:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 5:28 Alexander Shiyan
2023-10-06 6:49 ` Ahmad Fatoum
2023-10-06 10:00 ` Alexander Shiyan [this message]
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=CAP1tNvQS9A-+B4NCVQ75ct+ZqUaskRkqzBLBrg+cyB5YeSqOSg@mail.gmail.com \
--to=eagle.alexander923@gmail.com \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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