[alsa-devel] [PATCH 01/17] ALSA: line6: Split to each driver
Chris Rorvick
chris at rorvick.com
Tue Jan 20 06:59:05 CET 2015
Sounds good. I like the approach. I was futzing around with how to do
this, though I didn't spend too much time on it because I was antici-
pating more patches from you that would be difficult to merge. Using
the private_init callback is a nice idea and makes a necessarily large
change pretty easy to understand.
Chris
On Mon, Jan 19, 2015 at 1:37 PM, Takashi Iwai <tiwai at suse.de> wrote:
> 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