mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 08/11] ARM: i.MX6 realq7: prepare multiboard support
Date: Thu, 27 Jun 2013 09:03:26 +0200	[thread overview]
Message-ID: <20130627070326.GL27130@game.jcrosoft.org> (raw)
In-Reply-To: <1372233657-19455-9-git-send-email-s.hauer@pengutronix.de>

On 10:00 Wed 26 Jun     , Sascha Hauer wrote:
> Protect initcalls with the corrent of compatible.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  arch/arm/boards/dmo-mx6-realq7/board.c | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/arm/boards/dmo-mx6-realq7/board.c b/arch/arm/boards/dmo-mx6-realq7/board.c
> index 7983b88..9cf6c31 100644
> --- a/arch/arm/boards/dmo-mx6-realq7/board.c
> +++ b/arch/arm/boards/dmo-mx6-realq7/board.c
> @@ -81,6 +81,9 @@ static int ksz9031rn_phy_fixup(struct phy_device *dev)
>  
>  static int realq7_enet_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	mxc_iomux_v3_setup_multiple_pads(realq7_pads_gpio, ARRAY_SIZE(realq7_pads_gpio));
>  	gpio_direction_output(RQ7_GPIO_ENET_PHYADD2, 0);
>  	gpio_direction_output(RQ7_GPIO_ENET_MODE0, 1);
> @@ -102,19 +105,16 @@ static int realq7_enet_init(void)
>  }
>  fs_initcall(realq7_enet_init);
>  
> -static int realq7_devices_init(void)
> +static int realq7_env_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	imx6_bbu_internal_spi_i2c_register_handler("spiflash", "/dev/m25p0.barebox",
>  		BBU_HANDLER_FLAG_DEFAULT, NULL, 0, 0x00907000);
>  	imx6_bbu_internal_mmc_register_handler("mmc", "/dev/mmc3.barebox",
>  		0, NULL, 0, 0x00907000);
>  
> -	return 0;
> -}
> -device_initcall(realq7_devices_init);
> -
> -static int realq7_env_init(void)
> -{
>  	switch (bootsource_get()) {
>  	case BOOTSOURCE_MMC:
>  		device_detect_by_name("mmc3");
> @@ -136,8 +136,11 @@ late_initcall(realq7_env_init);
>  
>  static int realq7_console_init(void)
>  {
> +	if (!of_machine_is_compatible("dmo,imx6q-realq7"))
> +		return 0;
> +
>  	imx6_init_lowlevel();
>  
>  	return 0;
>  }
> -core_initcall(realq7_console_init);
> +postcore_initcall(realq7_console_init);

I really don't like those if (!of_mac......

can we have a struct os is the kernel?

It will help me on at91 to cleanup the at91 to move to empty board.h
and will allow to not be of only

Best Regards,
J.
> -- 
> 1.8.3.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-27  7:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  8:00 [PATCH] Multi board support Sascha Hauer
2013-06-26  8:00 ` [PATCH 01/11] ARM: i.MX: select SoC from board Sascha Hauer
2013-06-26  8:00 ` [PATCH 02/11] ARM: i.MX51 babbage: add board name to flash header file Sascha Hauer
2013-06-26  8:00 ` [PATCH 03/11] ARM: i.MX51 babbage: prepare for multiboard support Sascha Hauer
2013-06-26  8:00 ` [PATCH 04/11] ARM: i.MX51 babbage: Move over to multiboard Sascha Hauer
2013-06-26  8:00 ` [PATCH 05/11] ARM: i.MX53 loco: add board name to flash header file Sascha Hauer
2013-06-26  8:00 ` [PATCH 06/11] ARM: i.MX53 loco: prepare multiboard support Sascha Hauer
2013-06-26  8:00 ` [PATCH 07/11] ARM: i.MX53 loco: Move over to multiboard Sascha Hauer
2013-06-26  8:00 ` [PATCH 08/11] ARM: i.MX6 realq7: prepare multiboard support Sascha Hauer
2013-06-27  7:03   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-06-27 18:32     ` Sascha Hauer
2013-06-28  7:40       ` Jean-Christophe PLAGNIOL-VILLARD
2013-06-26  8:00 ` [PATCH 09/11] ARM: i.MX6 realq7: switch to multiboard Sascha Hauer
2013-06-26  8:00 ` [PATCH 10/11] ARM: i.MX51 efikasb: switch to multiboard support Sascha Hauer
2013-06-26  8:00 ` [PATCH 11/11] ARM: Add a imx_v7_defconfig Sascha Hauer

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=20130627070326.GL27130@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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