From: Benoit Goby Date: Tue, 21 Sep 2010 22:25:28 +0000 (-0700) Subject: mdm6600: Don't hardcode the number of ports X-Git-Tag: firefly_0821_release~9834^2~534 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d836d9945fa5f288615baae2617fec0361e6c881;p=firefly-linux-kernel-4.4.55.git mdm6600: Don't hardcode the number of ports Change-Id: I5ca689922638fb27546d1a27aa293751bd9c9790 Signed-off-by: Benoit Goby --- diff --git a/drivers/usb/serial/mdm6600.c b/drivers/usb/serial/mdm6600.c index 5e7ecbb31b81..9b9805d7090e 100644 --- a/drivers/usb/serial/mdm6600.c +++ b/drivers/usb/serial/mdm6600.c @@ -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; }