From: Sascha Hauer <s.hauer@pengutronix.de>
To: Andrey Smirnov <andrew.smirnov@gmail.com>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] at91sam9x5ek: Add appropriate compatibility guards to all initcalls
Date: Thu, 25 Jan 2018 08:17:45 +0100 [thread overview]
Message-ID: <20180125071745.mv5r7jkom7snuz5t@pengutronix.de> (raw)
In-Reply-To: <20180123143053.20623-1-andrew.smirnov@gmail.com>
On Tue, Jan 23, 2018 at 06:30:53AM -0800, Andrey Smirnov wrote:
> Add appropriate calls to of_machine_is_compatible() to all initcalls
> to avoid having those executed for wrong boards in multi-board build.
>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
> arch/arm/boards/at91sam9x5ek/hw_version.c | 3 +++
> arch/arm/boards/at91sam9x5ek/init.c | 13 +++++++++++++
> 2 files changed, 16 insertions(+)
Applied, thanks
Sascha
>
> diff --git a/arch/arm/boards/at91sam9x5ek/hw_version.c b/arch/arm/boards/at91sam9x5ek/hw_version.c
> index 10563cf98..f15cd3dc0 100644
> --- a/arch/arm/boards/at91sam9x5ek/hw_version.c
> +++ b/arch/arm/boards/at91sam9x5ek/hw_version.c
> @@ -253,6 +253,9 @@ static int cm_cogent_fixup(struct device_node *root, void *unused)
>
> static int at91sam9x5ek_devices_detect_hw(void)
> {
> + if (!of_machine_is_compatible("atmel,at91sam9x5ek"))
> + return 0;
> +
> at91sam9x5ek_devices_detect_one("/dev/ds24310");
> at91sam9x5ek_devices_detect_one("/dev/ds24311");
> at91sam9x5ek_devices_detect_one("/dev/ds24330");
> diff --git a/arch/arm/boards/at91sam9x5ek/init.c b/arch/arm/boards/at91sam9x5ek/init.c
> index 646cff5d6..649545e8a 100644
> --- a/arch/arm/boards/at91sam9x5ek/init.c
> +++ b/arch/arm/boards/at91sam9x5ek/init.c
> @@ -66,6 +66,10 @@ static struct sam9_smc_config cm_nand_smc_config = {
> static int ek_add_device_smc(void)
> {
> unsigned long csa;
> +
> + if (!of_machine_is_compatible("atmel,at91sam9x5ek"))
> + return 0;
> +
> csa = at91_sys_read(AT91_MATRIX_EBICSA);
>
> /* Enable CS3 */
> @@ -105,6 +109,9 @@ static int ek_register_mac_address(void)
> {
> int ret;
>
> + if (!of_machine_is_compatible("atmel,at91sam9x5ek"))
> + return 0;
> +
> ret = w1_local_mac_address_register(0, "tml", "w1-2d-0");
> if (!ret)
> return ret;
> @@ -158,6 +165,9 @@ static void ek_add_device_lcdc(void) {}
>
> static int at91sam9x5ek_devices_init(void)
> {
> + if (!of_machine_is_compatible("atmel,at91sam9x5ek"))
> + return 0;
> +
> ek_add_device_lcdc();
>
> armlinux_set_architecture(CONFIG_MACH_AT91SAM9X5EK);
> @@ -171,6 +181,9 @@ device_initcall(at91sam9x5ek_devices_init);
>
> static int at91sam9x5ek_console_init(void)
> {
> + if (!of_machine_is_compatible("atmel,at91sam9x5ek"))
> + return 0;
> +
> barebox_set_model("Atmel at91sam9x5-ek");
> barebox_set_hostname("at91sam9x5-ek");
>
> --
> 2.14.3
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2018-01-25 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-23 14:30 Andrey Smirnov
2018-01-25 7:17 ` Sascha Hauer [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=20180125071745.mv5r7jkom7snuz5t@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=andrew.smirnov@gmail.com \
--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