From: "Heiko Stübner" <heiko@sntech.de>
To: mturquette@baylibre.com, Stephen Boyd <sboyd@kernel.org>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v3 4/5] clk: clk-gpio: add driver for gated-fixed-clocks
Date: Fri, 06 Sep 2024 00:48:35 +0200 [thread overview]
Message-ID: <5168975.haC6HkEk0m@diego> (raw)
In-Reply-To: <9b92b5f03632e8793253ba75fc00f6e3.sboyd@kernel.org>
Am Mittwoch, 28. August 2024, 20:30:51 CEST schrieb Stephen Boyd:
> Quoting Heiko Stuebner (2024-08-28 03:15:02)
[leaving out all the "will fix" parts :-) ]
> > +static struct platform_driver gated_fixed_clk_driver = {
> > + .probe = clk_gated_fixed_probe,
> > + .driver = {
> > + .name = "gated-fixed-clk",
> > + .of_match_table = gated_fixed_clk_match_table,
> > + },
> > +};
> > +builtin_platform_driver(gated_fixed_clk_driver);
>
> The comment above builtin_platform_driver says "Each driver may only use
> this macro once". Seems that we need to expand the macro.
each _driver_, not each file is the important point I think.
Looking at the code generation, it just wants to use the name of the
driver struct for generating the init functions.
So in the builtin_driver macro [0] it wants to use the
gated_fixed_clk_driver to create the init-function as
gated_fixed_clk_driver_init() hence anybody using the macro a second time
for the same driver would create that function two times.
Also as can be seen with the imx gpc driver [1], the two-drivers in the
same file is already in use.
I've also done a practical test with that and did [2], which resulted in
both drivers getting registered as expected:
[ 0.132087] ----init gpio_clk_driver
[ 0.132160] ----init gated_fixed_clk_driver
So not sure, if I misinterpreted your comment, but I don't think changes
are necessary for this portion.
Heiko
[0] https://elixir.bootlin.com/linux/v6.10.8/source/include/linux/device/driver.h#L284
[1]
https://elixir.bootlin.com/linux/v6.10.8/source/drivers/pmdomain/imx/gpc.c#L239
https://elixir.bootlin.com/linux/v6.10.8/source/drivers/pmdomain/imx/gpc.c#L556
[2]
diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
index 1fc8b68786de..e306f554cd0f 100644
--- a/include/linux/device/driver.h
+++ b/include/linux/device/driver.h
@@ -284,6 +284,7 @@ module_exit(__driver##_exit);
#define builtin_driver(__driver, __register, ...) \
static int __init __driver##_init(void) \
{ \
+ printk("----init %s\n", __stringify(__driver)); \
return __register(&(__driver) , ##__VA_ARGS__); \
} \
device_initcall(__driver##_init);
next prev parent reply other threads:[~2024-09-05 22:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-28 10:14 [PATCH v3 0/5] Binding and driver for gated-fixed-clocks Heiko Stuebner
2024-08-28 10:14 ` [PATCH v3 1/5] dt-bindings: clocks: add binding " Heiko Stuebner
2024-08-28 13:37 ` Rob Herring
2024-08-28 15:43 ` Conor Dooley
2024-08-28 10:15 ` [PATCH v3 2/5] clk: clk-gpio: update documentation for gpio-gate clock Heiko Stuebner
2024-08-28 11:37 ` Diederik de Haas
2024-08-28 10:15 ` [PATCH v3 3/5] clk: clk-gpio: use dev_err_probe for gpio-get failure Heiko Stuebner
2024-08-28 10:15 ` [PATCH v3 4/5] clk: clk-gpio: add driver for gated-fixed-clocks Heiko Stuebner
2024-08-28 18:30 ` Stephen Boyd
2024-09-05 22:48 ` Heiko Stübner [this message]
2024-09-06 23:02 ` Stephen Boyd
2024-08-28 10:15 ` [PATCH v3 5/5] arm64: dts: rockchip: fix the pcie refclock oscillator on Rock 5 ITX Heiko Stuebner
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=5168975.haC6HkEk0m@diego \
--to=heiko@sntech.de \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.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).