[alsa-devel] [PATCH 01/17] ALSA: line6: Split to each driver

Chris Rorvick chris at rorvick.com
Mon Jan 19 19:00:01 CET 2015


On Mon, Jan 19, 2015 at 9:54 AM, Takashi Iwai <tiwai at suse.de> wrote:
> -static int line6_probe(struct usb_interface *interface,
> -                      const struct usb_device_id *id)
> +int line6_probe(struct usb_interface *interface,
> +               struct usb_line6 *line6,
> +               const struct line6_properties *properties,
> +               int (*private_init)(struct usb_interface *, struct usb_line6 *))
>  {
> -       enum line6_device_type devtype;
>         struct usb_device *usbdev;
> -       struct usb_line6 *line6;
> -       const struct line6_properties *properties;
>         int interface_number;
> -       int size = 0;
>         int ret;
>
> -       if (interface == NULL)
> -               return -ENODEV;
> +       if (!interface) {
> +               ret = -ENODEV;
> +               goto err_put;
> +       }
>         usbdev = interface_to_usbdev(interface);
> -       if (usbdev == NULL)
> -               return -ENODEV;
> +       if (!usbdev) {
> +               ret = -ENODEV;
> +               goto err_put;
> +       }

These NULL checks are unnecessary, right?  We could just assign `usbdev'
at declaration and be done with it.  But maybe that should be another
patch.

Chris


More information about the Alsa-devel mailing list