mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Vicente Bergas <vicencb@gmail.com>
To: barebox@lists.infradead.org
Cc: Vicente Bergas <vicencb@gmail.com>
Subject: [PATCH 1/6] OMAP4: check for usb availability at device registration
Date: Sat, 16 Mar 2013 23:59:37 +0100	[thread overview]
Message-ID: <1363474782-21973-2-git-send-email-vicencb@gmail.com> (raw)
In-Reply-To: <1363474782-21973-1-git-send-email-vicencb@gmail.com>

this way serial-over-usb driver is registered always, but the device is
only registered when booting from usb.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
---
 arch/arm/boards/archosg9/board.c      | 6 +++++-
 drivers/serial/serial_omap4_usbboot.c | 2 --
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/archosg9/board.c b/arch/arm/boards/archosg9/board.c
index bf247de..3ae7051 100644
--- a/arch/arm/boards/archosg9/board.c
+++ b/arch/arm/boards/archosg9/board.c
@@ -17,15 +17,19 @@
 #include <generated/mach-types.h>
 #include <mach/omap4-silicon.h>
 #include <mach/omap4-devices.h>
+#include <mach/omap4_rom_usb.h>
 #include <sizes.h>
 #include <i2c/i2c.h>
 #include <gpio.h>
 #include "archos_features.h"
 
 static int archosg9_console_init(void){
-	if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT))
+	if (IS_ENABLED(CONFIG_DRIVER_SERIAL_OMAP4_USBBOOT) &&
+		omap4_usbboot_ready()
+	){
 		add_generic_device("serial_omap4_usbboot", DEVICE_ID_DYNAMIC
 			, NULL, 0, 0, 0, NULL);
+	}
 	if (IS_ENABLED(CONFIG_DRIVER_SERIAL_NS16550)) {
 		gpio_direction_output(41, 0); /* gps_disable */
 		gpio_direction_output(34, 1); /* 1v8_pwron */
diff --git a/drivers/serial/serial_omap4_usbboot.c b/drivers/serial/serial_omap4_usbboot.c
index e377fc4..f0a2fd1 100644
--- a/drivers/serial/serial_omap4_usbboot.c
+++ b/drivers/serial/serial_omap4_usbboot.c
@@ -78,8 +78,6 @@ static struct driver_d serial_omap4_usbboot_driver = {
 
 static int serial_omap4_usbboot_init(void)
 {
-	if (!omap4_usbboot_ready())
-		return 0;
 	return platform_driver_register(&serial_omap4_usbboot_driver);
 }
 console_initcall(serial_omap4_usbboot_init);
-- 
1.8.2


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

  reply	other threads:[~2013-03-16 23:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16 22:59 [PATCH 0/6] ArchosG9: add keyboard input and new reset menu entries (v2) Vicente Bergas
2013-03-16 22:59 ` Vicente Bergas [this message]
2013-03-16 22:59 ` [PATCH 2/6] ArchosG9: zero all features before setting them Vicente Bergas
2013-03-16 22:59 ` [PATCH 3/6] gpio_keys: detect keys pressed before booting Vicente Bergas
2013-03-16 22:59 ` [PATCH 4/6] OMAP4: add command to select next boot device priority Vicente Bergas
2013-03-25  9:36   ` Sascha Hauer
2013-03-16 22:59 ` [PATCH 5/6] ArchosG9: add keyboard input and new reset menu entries Vicente Bergas
2013-03-16 22:59 ` [PATCH 6/6] menu: avoid errors when building submenus Vicente Bergas
2013-03-25  9:39 ` [PATCH 0/6] ArchosG9: add keyboard input and new reset menu entries (v2) Sascha Hauer
2013-03-25 13:56   ` vj

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=1363474782-21973-2-git-send-email-vicencb@gmail.com \
    --to=vicencb@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