From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 1/8] clk: imx: add common logic to detect early UART usage
Date: Wed, 23 Sep 2015 12:02:15 +0200 [thread overview]
Message-ID: <1443002535.25479.6.camel@pengutronix.de> (raw)
In-Reply-To: <CAOMZO5CDnRjxzcnxCDgXKN5SVkCxGqR5dMaectdPvVzpsb9=bQ@mail.gmail.com>
Am Montag, den 21.09.2015, 14:56 -0300 schrieb Fabio Estevam:
> On Mon, Sep 21, 2015 at 1:53 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> > Both earlycon and eralyprintk depend on the bootloader setup UART
>
> s/eralyprintk/earlyprintk
>
> > clocks being retained. This patch adds the common logic to detect such
> > situations and make the information available to the clock drivers, as
> > well as adding the facilities to disable those clocks at the end of
> > the kernel init.
>
> > +void __init imx_register_uart_clocks(struct clk ** const clks[])
> > +{
> > + if (imx_keep_uart_clocks) {
> > + int i;
> > +
> > + imx_uart_clocks = clks;
> > + for (i = 0; imx_uart_clocks[i]; i++)
> > + clk_prepare_enable(*imx_uart_clocks[i]);
>
> It would be better to check the return value from clk_prepare_enable()
> and propagate it in the case of error.
>
I don't see any value of that. We certainly don't want to abort probing
of the clock driver just because keeping the debug UART clocks enabled
did not work. Everything in this series is about improving the debug
experience, so I'm not a fan of adding code that makes it more likely to
break (possibly unrelated) things.
> > +
> > +static int __init imx_clk_disable_uart(void)
> > +{
> > + if (imx_keep_uart_clocks && imx_uart_clocks) {
> > + int i;
> > +
> > + for (i = 0; imx_uart_clocks[i]; i++)
> > + clk_disable_unprepare(*imx_uart_clocks[i]);
> > + }
> > +
> > + return 0;
>
> This function could be made 'void' instead.
This is an initcall, which have a fixed function prototype.
Regards,
Lucas
--
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2015-09-23 10:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-21 16:53 [PATCH v4 0/8] i.MX early debug UART clock fixes Lucas Stach
2015-09-21 16:53 ` [PATCH v4 1/8] clk: imx: add common logic to detect early UART usage Lucas Stach
2015-09-21 17:56 ` Fabio Estevam
2015-09-23 10:02 ` Lucas Stach [this message]
2015-09-21 16:53 ` [PATCH v4 2/8] clk: imx25: retain early UART clocks during kernel init Lucas Stach
2015-09-21 16:53 ` [PATCH v4 3/8] clk: imx27: " Lucas Stach
2015-09-21 16:54 ` [PATCH v4 4/8] clk: imx31: " Lucas Stach
2015-09-21 16:54 ` [PATCH v4 5/8] clk: imx35: " Lucas Stach
2015-09-21 16:54 ` [PATCH v4 6/8] clk: imx5: " Lucas Stach
2015-09-21 16:54 ` [PATCH v4 7/8] clk: imx6: " Lucas Stach
2015-09-21 16:54 ` [PATCH v4 8/8] clk: imx7d: " Lucas Stach
2015-09-24 15:20 ` [PATCH v4 0/8] i.MX early debug UART clock fixes Shawn Guo
2015-09-24 15:36 ` Lucas Stach
2015-10-02 19:45 ` Stephen Boyd
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=1443002535.25479.6.camel@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).