diff --git a/drivers/isdn/hisax/st5481_b.c b/drivers/isdn/hisax/st5481_b.c index 010d55996b26bf56c97004b674e265d1546e19e2..880d07b3f036ba05329f3f5733991abec05d19fa 100644 --- a/drivers/isdn/hisax/st5481_b.c +++ b/drivers/isdn/hisax/st5481_b.c @@ -257,13 +257,18 @@ static void st5481B_mode(struct st5481_bcs *bcs, int mode) static int st5481_setup_b_out(struct st5481_bcs *bcs) { struct usb_device *dev = bcs->adapter->usb_dev; - struct usb_host_interface *altsetting; + struct usb_interface *intf; + struct usb_host_interface *altsetting = NULL; struct usb_host_endpoint *endpoint; struct st5481_b_out *b_out = &bcs->b_out; DBG(4,""); - altsetting = &(dev->config->interface[0]->altsetting[3]); + intf = usb_ifnum_to_if(dev, 0); + if (intf) + altsetting = usb_altnum_to_altsetting(intf, 3); + if (!altsetting) + return -ENXIO; // Allocate URBs and buffers for the B channel out endpoint = &altsetting->endpoint[EP_B1_OUT - 1 + bcs->channel * 2]; diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c index 45a0300d06a443df2efa826ec1d0ce97d6de5aa8..5ff7fdf729ebd0b3517a29f828cafa9f6b17ed6f 100644 --- a/drivers/isdn/hisax/st5481_d.c +++ b/drivers/isdn/hisax/st5481_d.c @@ -652,13 +652,18 @@ static void ph_disconnect(struct st5481_adapter *adapter) static int st5481_setup_d_out(struct st5481_adapter *adapter) { struct usb_device *dev = adapter->usb_dev; - struct usb_host_interface *altsetting; + struct usb_interface *intf; + struct usb_host_interface *altsetting = NULL; struct usb_host_endpoint *endpoint; struct st5481_d_out *d_out = &adapter->d_out; DBG(2,""); - altsetting = &(dev->config->interface[0]->altsetting[3]); + intf = usb_ifnum_to_if(dev, 0); + if (intf) + altsetting = usb_altnum_to_altsetting(intf, 3); + if (!altsetting) + return -ENXIO; // Allocate URBs and buffers for the D channel out endpoint = &altsetting->endpoint[EP_D_OUT-1]; diff --git a/drivers/isdn/hisax/st5481_usb.c b/drivers/isdn/hisax/st5481_usb.c index bf5f0f09e0e02752967f6f5d3bfe476e03033955..04f9c5ce292fc36c07978ad6f00c06408aa3bfe7 100644 --- a/drivers/isdn/hisax/st5481_usb.c +++ b/drivers/isdn/hisax/st5481_usb.c @@ -244,7 +244,8 @@ int st5481_setup_usb(struct st5481_adapter *adapter) struct usb_device *dev = adapter->usb_dev; struct st5481_ctrl *ctrl = &adapter->ctrl; struct st5481_intr *intr = &adapter->intr; - struct usb_host_interface *altsetting; + struct usb_interface *intf; + struct usb_host_interface *altsetting = NULL; struct usb_host_endpoint *endpoint; int status; struct urb *urb; @@ -257,8 +258,11 @@ int st5481_setup_usb(struct st5481_adapter *adapter) return status; } - - altsetting = &(dev->config->interface[0]->altsetting[3]); + intf = usb_ifnum_to_if(dev, 0); + if (intf) + altsetting = usb_altnum_to_altsetting(intf, 3); + if (!altsetting) + return -ENXIO; // Check if the config is sane if ( altsetting->desc.bNumEndpoints != 7 ) {