]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/usb/core/message.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[mv-sheeva.git] / drivers / usb / core / message.c
index c021af3903723b3d27db15f2cc904cd80ed4bd36..316a746e0080ef8a0eface2341fbd8f3e612c60d 100644 (file)
@@ -11,9 +11,9 @@
 #include <linux/timer.h>
 #include <linux/ctype.h>
 #include <linux/device.h>
+#include <linux/scatterlist.h>
 #include <linux/usb/quirks.h>
 #include <asm/byteorder.h>
-#include <asm/scatterlist.h>
 
 #include "hcd.h"       /* for usbcore internals */
 #include "usb.h"
@@ -434,16 +434,14 @@ int usb_sg_init (
                if (dma) {
                        io->urbs [i]->transfer_dma = sg_dma_address (sg + i);
                        len = sg_dma_len (sg + i);
-#if defined(CONFIG_HIGHMEM) || defined(CONFIG_IOMMU)
+#if defined(CONFIG_HIGHMEM) || defined(CONFIG_GART_IOMMU)
                        io->urbs[i]->transfer_buffer = NULL;
 #else
-                       io->urbs[i]->transfer_buffer =
-                               page_address(sg[i].page) + sg[i].offset;
+                       io->urbs[i]->transfer_buffer = sg_virt(&sg[i]);
 #endif
                } else {
                        /* hc may use _only_ transfer_buffer */
-                       io->urbs [i]->transfer_buffer =
-                               page_address (sg [i].page) + sg [i].offset;
+                       io->urbs [i]->transfer_buffer = sg_virt(&sg[i]);
                        len = sg [i].length;
                }
 
@@ -1526,7 +1524,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
                new_interfaces = kmalloc(nintf * sizeof(*new_interfaces),
                                GFP_KERNEL);
                if (!new_interfaces) {
-                       dev_err(&dev->dev, "Out of memory");
+                       dev_err(&dev->dev, "Out of memory\n");
                        return -ENOMEM;
                }
 
@@ -1535,7 +1533,7 @@ int usb_set_configuration(struct usb_device *dev, int configuration)
                                        sizeof(struct usb_interface),
                                        GFP_KERNEL);
                        if (!new_interfaces[n]) {
-                               dev_err(&dev->dev, "Out of memory");
+                               dev_err(&dev->dev, "Out of memory\n");
                                ret = -ENOMEM;
 free_interfaces:
                                while (--n >= 0)
@@ -1643,7 +1641,13 @@ free_interfaces:
                                intf->dev.bus_id, ret);
                        continue;
                }
-               usb_create_sysfs_intf_files (intf);
+
+               /* The driver's probe method can call usb_set_interface(),
+                * which would mean the interface's sysfs files are already
+                * created.  Just in case, we'll remove them first.
+                */
+               usb_remove_sysfs_intf_files(intf);
+               usb_create_sysfs_intf_files(intf);
        }
 
        usb_autosuspend_device(dev);