[WCNCR00146539] usb: fix interface_to_usbdev() compilation error
[Description]
Fix a dereference of a void pointer error while compiling
driver in linux kernel 2.6.32.
In kernel 2.6.32, interface_to_usbdev() is a macro, we
need use temporary local pointer as its parameter to
avoid compilation error.
Change-Id: Ia4cf4f318601c513bf52b5a07cff6255f138f12a
Feature: usb
Signed-off-by: Awk Jiang <awk.jiang@mediatek.com>
CR-Id: WCNCR00146539
diff --git a/os/linux/hif/usb/usb.c b/os/linux/hif/usb/usb.c
index 410c0fa..1033174 100644
--- a/os/linux/hif/usb/usb.c
+++ b/os/linux/hif/usb/usb.c
@@ -1410,7 +1410,10 @@
void glGetDev(PVOID ctx, struct device **dev)
{
- *dev = &(interface_to_usbdev((struct usb_interface *)ctx)->dev);
+ struct usb_interface *prUsbIntf = (struct usb_interface *) ctx;
+ struct usb_device *prUsbDev = interface_to_usbdev(prUsbIntf);
+
+ *dev = &prUsbDev->dev;
}
void glGetHifDev(P_GL_HIF_INFO_T prHif, struct device **dev)