From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] sunxi: musb: Improve output during probing
Date: Mon, 22 Jun 2015 17:39:39 +0200 [thread overview]
Message-ID: <55882C3B.9010709@redhat.com> (raw)
In-Reply-To: <1434873606.17598.2.camel@hellion.org.uk>
Hi,
On 21-06-15 10:00, Ian Campbell wrote:
> On Sat, 2015-06-20 at 17:35 +0200, Hans de Goede wrote:
>> When we return an error the usb core will log a message, so in this case
>> do not print a newline, instead print ": " after our identifier as a
>> seperator between our identifier and the error message logged by the core.
>
> "separator".
Fixed in my personal tree.
> This seems like a lot of fragile faff second guessing what some other
> component does (and is going to do in the future).
Right, but if that other component changes all we end up with is less
then optimal console output it will not really break anything.
Can we not have musb
> take over init time logging completely
The problem is that all the other usb host drivers also depend on this
behavior of the usb core.
> or just live with:
> MUSB OTG: Failed host init
> Flux capacitor has reversed polarity
> which I suppose is roughly how it appears today?
I do not like just living with it, I believe a certain amount of spit
and polish is important, even for text messages like these.
I would not have written this if I did not consider the current situation
ugly :)
How about the following:
Subject: [PATCH 1/3] sunxi: musb: Improve output during probing
When we return an error the usb core will log a message, so in this case
do not print anything.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
--- a/drivers/usb/musb-new/sunxi.c
+++ b/drivers/usb/musb-new/sunxi.c
@@ -301,21 +301,22 @@ int musb_usb_probe(struct udevice *dev)
{
struct musb_host_data *host = dev_get_priv(dev);
struct usb_bus_priv *priv = dev_get_uclass_priv(dev);
+ int ret;
priv->desc_before_addr = true;
if (!host->host) {
host->host = musb_init_controller(&musb_plat, NULL,
(void *)SUNXI_USB0_BASE);
- if (!host->host) {
- printf("Failed to init the controller\n");
+ if (!host->host)
return -EIO;
- }
}
- printf("MUSB OTG in host-mode\n");
+ ret = musb_lowlevel_init(host);
+ if (ret == 0)
+ printf("MUSB OTG\n");
- return musb_lowlevel_init(host);
+ return ret;
}
int musb_usb_remove(struct udevice *dev)
This is exactly what the other host drivers do, only print
something on success, and leave printing errors up to the
caller.
Regards,
Hans
next prev parent reply other threads:[~2015-06-22 15:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 15:35 [U-Boot] [PATCH 0/3] sunxi: Enable both ehci and otg in host mode on various boards Hans de Goede
2015-06-20 15:35 ` [U-Boot] [PATCH 1/3] sunxi: musb: Improve output during probing Hans de Goede
2015-06-21 8:00 ` Ian Campbell
2015-06-22 15:39 ` Hans de Goede [this message]
2015-06-22 16:11 ` Ian Campbell
2015-06-23 10:02 ` Hans de Goede
2015-06-20 15:35 ` [U-Boot] [PATCH 2/3] sunxi: musb: Stop treating not having a vbus-det gpio as an error Hans de Goede
2015-06-21 8:00 ` Ian Campbell
2015-06-20 15:35 ` [U-Boot] [PATCH 3/3] sunxi: Enable both ehci and otg in host mode on various boards Hans de Goede
2015-06-21 8:01 ` Ian Campbell
2015-06-22 15:40 ` Hans de Goede
2015-06-20 16:08 ` [U-Boot] [PATCH 0/3] " Marek Vasut
2015-06-20 18:12 ` Hans de Goede
2015-06-20 18:26 ` Marek Vasut
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=55882C3B.9010709@redhat.com \
--to=hdegoede@redhat.com \
--cc=u-boot@lists.denx.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