From: Marco Felsch <m.felsch@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/3] driver: support Linux device/driver OF struct member names
Date: Fri, 9 Dec 2022 10:19:59 +0100 [thread overview]
Message-ID: <20221209091959.yuhljzmieofxm2zr@pengutronix.de> (raw)
In-Reply-To: <20221209071002.3765134-1-a.fatoum@pengutronix.de>
On 22-12-09, Ahmad Fatoum wrote:
> When porting drivers from Linux, one of the modifications that needs to
> be done is to rename all .of_node to .device_node and of_match_table
> to of_compatible. Just accept both names. It comes at no extra cost.
>
> Once all barebox drivers use the Linux naming, we could drop the union
> again.
Nice :)
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
> include/driver.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/include/driver.h b/include/driver.h
> index 2386949c312a..1c50b79886c1 100644
> --- a/include/driver.h
> +++ b/include/driver.h
> @@ -74,7 +74,10 @@ struct device_d {
> struct list_head cdevs;
>
> const struct platform_device_id *id_entry;
> - struct device_node *device_node;
> + union {
> + struct device_node *device_node;
> + struct device_node *of_node;
> + };
>
> const struct of_device_id *of_id_entry;
>
> @@ -113,7 +116,10 @@ struct driver_d {
> struct bus_type *bus;
>
> const struct platform_device_id *id_table;
> - const struct of_device_id *of_compatible;
> + union {
> + const struct of_device_id *of_compatible;
> + const struct of_device_id *of_match_table;
> + };
> };
>
> /*@}*/ /* do not delete, doxygen relevant */
> --
> 2.30.2
>
>
>
prev parent reply other threads:[~2022-12-09 9:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 7:10 Ahmad Fatoum
2022-12-09 7:10 ` [PATCH 2/3] clk: add prepare/unprepare helpers Ahmad Fatoum
2022-12-16 6:38 ` Sascha Hauer
2022-12-09 7:10 ` [PATCH 3/3] of: provide of_node_get and of_node_put stubs Ahmad Fatoum
2022-12-09 9:19 ` Marco Felsch [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=20221209091959.yuhljzmieofxm2zr@pengutronix.de \
--to=m.felsch@pengutronix.de \
--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