From d836d9945fa5f288615baae2617fec0361e6c881 Mon Sep 17 00:00:00 2001 From: Benoit Goby Date: Tue, 21 Sep 2010 15:25:28 -0700 Subject: [PATCH] mdm6600: Don't hardcode the number of ports Change-Id: I5ca689922638fb27546d1a27aa293751bd9c9790 Signed-off-by: Benoit Goby --- drivers/usb/serial/mdm6600.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } -- 2.34.1