]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: gadget: udc-core: Do not report -EISNAM error from gadgetfs
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 28 Sep 2013 03:05:34 +0000 (00:05 -0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 4 Oct 2013 14:44:43 +0000 (09:44 -0500)
When mounting a gadgetfs the following error message is seen:

$ modprobe gadgetfs
gadgetfs: USB Gadget filesystem, version 24 Aug 2004
$ mkdir  /dev/gadget
$ mount -t gadgetfs none /dev/gadget
nop ci_hdrc.0: failed to start (null): -120

The error comes from gadgetfs_probe(), which returns -EISNAM (-120).

As Alan Stern explains[1], this is the normal behavior:

"It is a temporary measure, used only when the file system is set up
initially.  The real bind routine is gadgetfs_bind(), which gets called
when userspace configures the gadget.

In short, this is how it is intended to work.  It isn't a bug."

[1] http://marc.info/?l=linux-usb&m=138029668707075&w=2

So in order to prevent the error message, do not report EISNAM as an error.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc-core.c

index 59891b1c48fc2e7a04febe488b979b23f3a1cb6f..27768a7d986a7f84e66d510be82cab2c513c7367 100644 (file)
@@ -356,7 +356,8 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
        kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);
        return 0;
 err1:
-       dev_err(&udc->dev, "failed to start %s: %d\n",
+       if (ret != -EISNAM)
+               dev_err(&udc->dev, "failed to start %s: %d\n",
                        udc->driver->function, ret);
        udc->driver = NULL;
        udc->dev.driver = NULL;