From: Stephen Boyd <sboyd@kernel.org>
To: Claudiu Beznea <claudiu.beznea@tuxon.dev>,
alexandre.belloni@bootlin.com, mripard@kernel.org,
mturquette@baylibre.com, nicolas.ferre@microchip.com
Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, varshini.rajendran@microchip.com,
Claudiu Beznea <claudiu.beznea@tuxon.dev>
Subject: Re: [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data
Date: Fri, 28 Jul 2023 20:28:38 -0700 [thread overview]
Message-ID: <412f9209637e6eb861cd07e1d6dbc346.sboyd@kernel.org> (raw)
In-Reply-To: <20230727053156.13587-4-claudiu.beznea@tuxon.dev>
Quoting Claudiu Beznea (2023-07-26 22:31:17)
> @@ -177,31 +178,34 @@ static const struct {
>
> static void __init sam9x60_pmc_setup(struct device_node *np)
> {
> + struct clk_hw *td_slck_hw, *md_slck_hw, *main_xtal_hw, *main_rc_hw, *main_osc_hw;
> + struct clk_hw *parent_hws[6], *hw, *usbck_hw;
> + static struct clk_parent_data parent_data;
> struct clk_range range = CLK_RANGE(0, 0);
> - const char *td_slck_name, *md_slck_name, *mainxtal_name;
> + const char *main_xtal_name = "main_xtal";
> struct pmc_data *sam9x60_pmc;
> - const char *parent_names[6];
> - struct clk_hw *main_osc_hw;
> struct regmap *regmap;
> - struct clk_hw *hw;
> + struct clk *clk;
> int i;
>
> - i = of_property_match_string(np, "clock-names", "td_slck");
> - if (i < 0)
> + clk = of_clk_get_by_name(np, "td_slck");
> + if (IS_ERR(clk))
> return;
> -
> - td_slck_name = of_clk_get_parent_name(np, i);
> -
> - i = of_property_match_string(np, "clock-names", "md_slck");
> - if (i < 0)
> + td_slck_hw = __clk_get_hw(clk);
Don't introduce more usage of __clk_get_hw(). The index for "td_slck"
should be known, and it can be used as the index member in struct
clk_parent_data. This allows the clk framework to lazily find the
parent, instead of requiring the parent to be registered before this
code runs. It also reduces the usage of __clk_get_hw().
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-07-29 3:29 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 5:31 [PATCH 00/42] clk: at91: add support for parent_data and parent_hw (take #2) Claudiu Beznea
2023-07-27 5:31 ` [PATCH 01/42] clk: at91: sama7g5: check __clk_get_hw() argument for errors Claudiu Beznea
2023-07-27 5:31 ` [PATCH 02/42] clk: at91: clk-usb: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 03/42] clk: at91: sam9x60: switch to parent_hw and parent_data Claudiu Beznea
2023-07-29 3:28 ` Stephen Boyd [this message]
2023-08-02 4:24 ` claudiu beznea
2023-09-09 0:06 ` Stephen Boyd
2023-07-27 5:31 ` [PATCH 04/42] clk: at91: sam9x60: make checkpatch.pl happy Claudiu Beznea
2023-07-27 5:31 ` [PATCH 05/42] clk: at91: clk-pll: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 06/42] clk: at91: clk-audio-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 07/42] clk: at91: clk-plldiv: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 08/42] clk: at91: clk-h32mx: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 09/42] clk: at91: clk-i2s-mux: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 10/42] clk: at91: sama5d2: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 11/42] clk: at91: clk-smd: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 12/42] clk: at91: sama5d3: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 13/42] clk: at91: sama5d3: make checkpatch.pl happy Claudiu Beznea
2023-07-27 5:31 ` [PATCH 14/42] clk: at91: sama5d4: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 15/42] clk: at91: at91sam9x5: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 16/42] clk: at91: at91rm9200: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 17/42] clk: at91: at91rm9200: fix checkpatch.pl check Claudiu Beznea
2023-07-27 8:46 ` Krzysztof Kozlowski
2023-07-27 5:31 ` [PATCH 18/42] " Claudiu Beznea
2023-07-27 8:47 ` Krzysztof Kozlowski
2023-07-27 5:31 ` [PATCH 19/42] clk: at91: clk-slow: add support for parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 20/42] clk: at91: at91sam9260: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 21/42] clk: at91: at91sam9g45: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 22/42] clk: at91: at91sam9g45: fix checkpatch.pl check Claudiu Beznea
2023-07-27 5:31 ` [PATCH 23/42] clk: at91: at91sam9n12: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 24/42] clk: at91: at91sam9n12: remove checkpatch.pl checks Claudiu Beznea
2023-07-27 5:31 ` [PATCH 25/42] clk: at91: at91sam9rl: switch to parent_hw Claudiu Beznea
2023-07-27 5:31 ` [PATCH 26/42] clk: at91: dt-compat: switch to parent_hw and parent_data Claudiu Beznea
2023-07-27 5:31 ` [PATCH 27/42] clk: at91: clk-audio-pll: remove parent_names support Claudiu Beznea
2023-07-27 5:31 ` [PATCH 28/42] clk: at91: clk-generated: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 29/42] clk: at91: clk-h32mx: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 30/42] clk: at91: clk-i2s-mux: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 31/42] clk: at91: clk-main: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 32/42] clk: at91: clk-master: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 33/42] clk: at91: clk-peripheral: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 34/42] clk: at91: clk-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 35/42] clk: at91: clk-plldiv: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 36/42] clk: at91: clk-programmable: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 37/42] clk: at91: clk-sam9x60-pll: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 38/42] clk: at91: clk-slow: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 39/42] clk: at91: clk-smd: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 40/42] clk: at91: clk-system: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 41/42] clk: at91: clk-usb: " Claudiu Beznea
2023-07-27 5:31 ` [PATCH 42/42] clk: at91: clk-utmi: " Claudiu Beznea
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=412f9209637e6eb861cd07e1d6dbc346.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=varshini.rajendran@microchip.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;
as well as URLs for NNTP newsgroup(s).