X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fcore%2Fmessage.c;h=fe47d145255ae95f248dbe6825c9abc7836e1bb8;hb=849c529f57020cc47085400edd5e641d95cd4faf;hp=c311f67b7f0824dba591b50d4b21f943827349b0;hpb=7ed7fe5e82c9fc8473974fbd7389d169b8f17c77;p=linux-2.6 diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index c311f67b7f..fe47d14525 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -312,7 +312,7 @@ static void sg_complete(struct urb *urb) retval != -EBUSY) dev_err(&io->dev->dev, "%s, unlink --> %d\n", - __FUNCTION__, retval); + __func__, retval); } else if (urb == io->urbs [i]) found = 1; } @@ -394,7 +394,9 @@ int usb_sg_init(struct usb_sg_request *io, struct usb_device *dev, if (!io->urbs) goto nomem; - urb_flags = URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT; + urb_flags = URB_NO_INTERRUPT; + if (dma) + urb_flags |= URB_NO_TRANSFER_DMA_MAP; if (usb_pipein(pipe)) urb_flags |= URB_SHORT_NOT_OK; @@ -550,7 +552,7 @@ void usb_sg_wait(struct usb_sg_request *io) io->urbs[i]->dev = NULL; io->urbs[i]->status = retval; dev_dbg(&io->dev->dev, "%s, submit --> %d\n", - __FUNCTION__, retval); + __func__, retval); usb_sg_cancel(io); } spin_lock_irq(&io->lock); @@ -600,7 +602,7 @@ void usb_sg_cancel(struct usb_sg_request *io) retval = usb_unlink_urb(io->urbs [i]); if (retval != -EINPROGRESS && retval != -EBUSY) dev_warn(&io->dev->dev, "%s, unlink --> %d\n", - __FUNCTION__, retval); + __func__, retval); } spin_lock(&io->lock); } @@ -784,7 +786,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) if (size <= 0 || !buf || !index) return -EINVAL; buf[0] = 0; - tbuf = kmalloc(256, GFP_KERNEL); + tbuf = kmalloc(256, GFP_NOIO); if (!tbuf) return -ENOMEM; @@ -1068,7 +1070,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) { int i; - dev_dbg(&dev->dev, "%s nuking %s URBs\n", __FUNCTION__, + dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__, skip_ep0 ? "non-ep0" : "all"); for (i = skip_ep0; i < 16; ++i) { usb_disable_endpoint(dev, i); @@ -1089,8 +1091,8 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0) continue; dev_dbg(&dev->dev, "unregistering interface %s\n", interface->dev.bus_id); - usb_remove_sysfs_intf_files(interface); device_del(&interface->dev); + usb_remove_sysfs_intf_files(interface); } /* Now that the interfaces are unbound, nobody should @@ -1231,7 +1233,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate) */ /* prevent submissions using previous endpoint settings */ - if (iface->cur_altsetting != alt && device_is_registered(&iface->dev)) + if (iface->cur_altsetting != alt) usb_remove_sysfs_intf_files(iface); usb_disable_interface(dev, iface); @@ -1330,8 +1332,7 @@ int usb_reset_configuration(struct usb_device *dev) struct usb_interface *intf = config->interface[i]; struct usb_host_interface *alt; - if (device_is_registered(&intf->dev)) - usb_remove_sysfs_intf_files(intf); + usb_remove_sysfs_intf_files(intf); alt = usb_altnum_to_altsetting(intf, 0); /* No altsetting 0? We'll assume the first altsetting. @@ -1606,6 +1607,7 @@ free_interfaces: intf->dev.driver = NULL; intf->dev.bus = &usb_bus_type; intf->dev.type = &usb_if_device_type; + intf->dev.groups = usb_interface_groups; intf->dev.dma_mask = dev->dev.dma_mask; device_initialize(&intf->dev); mark_quiesced(intf);