mdm6600: Don't hardcode the number of ports
authorBenoit Goby <benoit@android.com>
Tue, 21 Sep 2010 22:25:28 +0000 (15:25 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:51:58 +0000 (16:51 -0700)
Change-Id: I5ca689922638fb27546d1a27aa293751bd9c9790
Signed-off-by: Benoit Goby <benoit@android.com>
drivers/usb/serial/mdm6600.c

index 5e7ecbb31b81deca1ce1370b07da5359d1e70a31..9b9805d7090e19c7ee39ed0a6ff18d2625a7e5a6 100644 (file)
@@ -811,11 +811,12 @@ static int mdm6600_reset_resume(struct usb_interface *intf)
        return mdm6600_resume(intf);
 }
 
-int mdm6600_probe(struct usb_interface *interface,
-                              const struct usb_device_id *id)
+int mdm6600_probe(struct usb_serial *serial, const struct usb_device_id *id)
 {
-       /* we only support 1 modem (5 ports) */
-       if (mdm6600_attached_ports > 4) {
+       struct usb_device *dev = interface_to_usbdev(serial->interface);
+
+       /* we only support 1 modem */
+       if (mdm6600_attached_ports >= dev->config->desc.bNumInterfaces) {
                pr_err("%s: only one modem supported", __func__);
                return -EBUSY;
        }