On Mon, 19 Jun 2006 17:23:09 -0300, [EMAIL PROTECTED] wrote:

> From: Luiz Fernando N. Capitulino <[EMAIL PROTECTED]>

> +static int driver_num_ports(struct usb_serial *serial,
> +                         struct usb_interface *interface)
> +{
> +     if (!try_module_get(serial->type->driver.owner)) {
> +             dev_err(&interface->dev, "module get failed, exiting\n");
> +             return -EIO;
> +     }
> +
> +     nr_ports = serial->type->calc_num_ports(serial);
> +     module_put(serial->type->driver.owner);
> +     return nr_ports;
> +}

> +             num_ports = driver_num_ports(serial, interface);
> +             if (num_ports < 0) {
> +                     dev_err(&interface->dev,
> +                             "%s - driver_num_ports() failed\n",
> +                             __FUNCTION__);
> +                     kfree(serial);
> +                     return num_ports;
> +             } else if (!num_ports)

This seems like a clear case of double-printing on error.
Probably want to drop the first dev_err, or drop the second one
and add dev_error if calc_num_ports fails.

Also, there's no need for "else" after a return.

-- Pete


_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to