Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfb7fb79e913f60330037d1f302efee28d5f6770
Commit:     bfb7fb79e913f60330037d1f302efee28d5f6770
Parent:     943c441948581bd01ab196a4d32da88bfa0f13ce
Author:     Wojtek Kaniewski <[EMAIL PROTECTED]>
AuthorDate: Fri Dec 8 03:26:00 2006 -0800
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Wed Dec 20 10:14:27 2006 -0800

    USB: at91_udc: Additional checks
    
    This patch performs additional checks in at91_udc, just in case of
    some spurious interrupts or device enumeration.
    
    Signed-off-by: Wojtek Kaniewski <[EMAIL PROTECTED]>
    Acked-by: David Brownell <[EMAIL PROTECTED]>
    Cc: Andrew Victor <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/at91_udc.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 1926d39..812c733 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -955,7 +955,10 @@ static int at91_vbus_session(struct usb_gadget *gadget, 
int is_active)
        // VDBG("vbus %s\n", is_active ? "on" : "off");
        local_irq_save(flags);
        udc->vbus = (is_active != 0);
-       pullup(udc, is_active);
+       if (udc->driver)
+               pullup(udc, is_active);
+       else
+               pullup(udc, 0);
        local_irq_restore(flags);
        return 0;
 }
@@ -1241,7 +1244,10 @@ static void handle_setup(struct at91_udc *udc, struct 
at91_ep *ep, u32 csr)
 #undef w_length
 
        /* pass request up to the gadget driver */
-       status = udc->driver->setup(&udc->gadget, &pkt.r);
+       if (udc->driver)
+               status = udc->driver->setup(&udc->gadget, &pkt.r);
+       else
+               status = -ENODEV;
        if (status < 0) {
 stall:
                VDBG("req %02x.%02x protocol STALL; stat %d\n",
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to