[PATCH] USB: fix usb_find_interface for ppc64

Fix usb_find_interface. You cannot case pointers to int and long on
a big-endian 64-bitter without consequences.

Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
commit f5691d70d4aeec0ac9cff11f0cabb7d5a1735705
tree 124e1d04ab52425be1417e71387ae7036e03152c
parent a9714c845c0681a203a9ae22aa5165ec72c51d33
author Pete Zaitcev <[EMAIL PROTECTED]> Wed, 21 Dec 2005 17:24:54 -0800
committer Greg Kroah-Hartman <[EMAIL PROTECTED]> Wed, 04 Jan 2006 13:51:44 -0800

 drivers/usb/core/usb.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 6ee2b53..56a3520 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -192,20 +192,23 @@ void usb_driver_release_interface(struct
        iface->condition = USB_INTERFACE_UNBOUND;
        mark_quiesced(iface);
 }
+struct find_interface_arg {
+       int minor;
+       struct usb_interface *interface;
+};
 
 static int __find_interface(struct device * dev, void * data)
 {
-       struct usb_interface ** ret = (struct usb_interface **)data;
-       struct usb_interface * intf = *ret;
-       int *minor = (int *)data;
+       struct find_interface_arg *arg = data;
+       struct usb_interface *intf;
 
        /* can't look at usb devices, only interfaces */
        if (dev->driver == &usb_generic_driver)
                return 0;
 
        intf = to_usb_interface(dev);
-       if (intf->minor != -1 && intf->minor == *minor) {
-               *ret = intf;
+       if (intf->minor != -1 && intf->minor == arg->minor) {
+               arg->interface = intf;
                return 1;
        }
        return 0;
@@ -222,12 +225,12 @@ static int __find_interface(struct devic
  */
 struct usb_interface *usb_find_interface(struct usb_driver *drv, int minor)
 {
-       struct usb_interface *intf = (struct usb_interface *)(long)minor;
-       int ret;
-
-       ret = driver_for_each_device(&drv->driver, NULL, &intf, 
__find_interface);
+       struct find_interface_arg argb;
 
-       return ret ? intf : NULL;
+       argb.minor = minor;
+       argb.interface = NULL;
+       driver_for_each_device(&drv->driver, NULL, &argb, __find_interface);
+       return argb.interface;
 }
 
 #ifdef CONFIG_HOTPLUG



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to