mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 4/4] ARM: i.MX: use device_detect_by_name where applicable
Date: Wed, 26 Jun 2013 09:33:16 +0200	[thread overview]
Message-ID: <1372231996-1042-5-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1372231996-1042-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/boards/dmo-mx6-realq7/board.c      | 6 +-----
 arch/arm/boards/freescale-mx53-loco/board.c | 4 +---
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boards/dmo-mx6-realq7/board.c b/arch/arm/boards/dmo-mx6-realq7/board.c
index b2a27a4..7983b88 100644
--- a/arch/arm/boards/dmo-mx6-realq7/board.c
+++ b/arch/arm/boards/dmo-mx6-realq7/board.c
@@ -117,11 +117,7 @@ static int realq7_env_init(void)
 {
 	switch (bootsource_get()) {
 	case BOOTSOURCE_MMC:
-		if (!IS_ENABLED(CONFIG_MCI_STARTUP)) {
-			struct device_d *dev = get_device_by_name("mmc3");
-			if (dev)
-				device_detect(dev);
-		}
+		device_detect_by_name("mmc3");
 		devfs_add_partition("mmc3", 0, SZ_1M, DEVFS_PARTITION_FIXED, "mmc3.barebox");
 		devfs_add_partition("mmc3", SZ_1M, SZ_1M, DEVFS_PARTITION_FIXED, "mmc3.bareboxenv");
 		default_environment_path = "/dev/mmc3.bareboxenv";
diff --git a/arch/arm/boards/freescale-mx53-loco/board.c b/arch/arm/boards/freescale-mx53-loco/board.c
index 2f51128..aaf5db4 100644
--- a/arch/arm/boards/freescale-mx53-loco/board.c
+++ b/arch/arm/boards/freescale-mx53-loco/board.c
@@ -81,12 +81,10 @@ static void loco_fec_reset(void)
 
 static int loco_late_init(void)
 {
-	struct device_d *dev = get_device_by_name("mmc0");
 	struct mc34708 *mc34708;
 	int rev;
 
-	if (dev)
-		device_detect(dev);
+	device_detect_by_name("mmc0");
 
 	devfs_add_partition("mmc0", 0x40000, 0x20000, DEVFS_PARTITION_FIXED, "env0");
 
-- 
1.8.3.1


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

      parent reply	other threads:[~2013-06-26  7:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  7:33 [PATCH] detect environment device on some boards Sascha Hauer
2013-06-26  7:33 ` [PATCH 1/4] driver: implement device_detect_by_name function Sascha Hauer
2013-06-26  7:33 ` [PATCH 2/4] ARM: i.MX51 efikasb: detect environment device Sascha Hauer
2013-06-26  7:33 ` [PATCH 3/4] ARM: i.MX51 babbage: " Sascha Hauer
2013-06-26  7:33 ` 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=1372231996-1042-5-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@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