From: Takashi Iwai Subject: Re: [PATCH 01/17] ALSA: line6: Split to each driver Date: Mon, 19 Jan 2015 20:37:36 +0100 Message-ID: References: <1421682891-11594-1-git-send-email-tiwai@suse.de> <1421682891-11594-2-git-send-email-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 07E692614F8 for ; Mon, 19 Jan 2015 20:37:39 +0100 (CET) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Chris Rorvick Cc: Stefan Hajnoczi , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 19 Jan 2015 12:00:01 -0600, Chris Rorvick wrote: > > On Mon, Jan 19, 2015 at 9:54 AM, Takashi Iwai 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