LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Felipe Balbi <me@felipebalbi.com>
To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Cc: david-b@pacbell.net, tony@atomide.com, Felipe Balbi <me@felipebalbi.com>
Subject: [PATCH 4/4] USB: OTG: Add check for roothub initialization
Date: Sat, 19 Jan 2008 16:37:25 +0200 [thread overview]
Message-ID: <1200753446-9378-5-git-send-email-me@felipebalbi.com> (raw)
In-Reply-To: <1200753446-9378-4-git-send-email-me@felipebalbi.com>
From: Tony Lindgren <tony@atomide.com>
Roothub may not be initialized if no gadget is loaded on musb
for example. Add check for roothub initialization. Also make
comment more accurate.
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <me@felipebalbi.com>
---
drivers/usb/core/otg.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/usb/core/otg.c b/drivers/usb/core/otg.c
index e9ece31..9a2ce7e 100644
--- a/drivers/usb/core/otg.c
+++ b/drivers/usb/core/otg.c
@@ -33,16 +33,25 @@ struct otg_transceiver *otg_get_transceiver(void)
}
EXPORT_SYMBOL(otg_get_transceiver);
-/* OTG MESSAGE: report errors here, customize to match your product */
+/*
+ * OTG MESSAGE: report errors here, customize to match your product
+ * See also otg_last_error_show().
+ */
void otg_set_error(struct otg_transceiver *x, enum usb_otg_error errno)
{
if (!x)
return;
+
if (!x->tpl_enabled)
x->last_error = OTG_ERR_DEVICE_SUPPORTED;
else
x->last_error = errno;
+ if (!x->host->root_hub) {
+ printk(KERN_WARNING "OTG: root hub not yet initialized\n");
+ return;
+ }
+
sysfs_notify(&x->host->root_hub->dev.kobj, NULL, "otg_last_error");
}
EXPORT_SYMBOL(otg_set_error);
--
1.5.4.rc3.24.gb53139
next prev parent reply other threads:[~2008-01-19 14:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-19 14:37 [PATCH 0/4] USB OTG Targeted Peripheral List changes Felipe Balbi
2008-01-19 14:37 ` [PATCH 1/4] USB: OTG: Introduce new otg.c code Felipe Balbi
2008-01-19 14:37 ` [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic Felipe Balbi
2008-01-19 14:37 ` [PATCH 3/4] USB: OTG: Start using new otg tpl Felipe Balbi
2008-01-19 14:37 ` Felipe Balbi [this message]
2008-01-19 14:37 ` [PATCH] USB: OTG: Make otg_tpl come from platform_data Felipe Balbi
2008-08-25 13:35 ` [PATCH 2/4] USB: OTG: Make otg_get_transceiver() and otg_set_transceiver() generic pHilipp Zabel
2008-08-25 13:39 ` Felipe Balbi
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=1200753446-9378-5-git-send-email-me@felipebalbi.com \
--to=me@felipebalbi.com \
--cc=david-b@pacbell.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=tony@atomide.com \
--subject='Re: [PATCH 4/4] USB: OTG: Add check for roothub initialization' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).