- struct usb_interface *ifp = ov->dev->config[0].interface[0];
- __u16 mxps = ifp->altsetting[7].endpoint[0].desc.wMaxPacketSize;
+ struct usb_interface *ifp;
+ struct usb_host_interface *alt;
+ __u16 mxps = 0;
+
+ ifp = usb_ifnum_to_if(ov->dev, 0);
+ if (ifp) {
+ alt = usb_altnum_to_altsetting(ifp, 7);
+ if (alt)
+ mxps = alt->endpoint[0].desc.wMaxPacketSize;
+ }