[alsa-devel] [PATCH 01/17] ALSA: line6: Split to each driver
Takashi Iwai
tiwai at suse.de
Mon Jan 19 20:37:36 CET 2015
At Mon, 19 Jan 2015 12:00:01 -0600,
Chris Rorvick wrote:
>
> 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.
Right, the cleanup can be done later, as this patch is merely a
transition.
Takashi
More information about the Alsa-devel
mailing list