Commit 8bb84227 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] cx231xx: Simplify interface checking logic at probe

Just a cleanup patch. Removes one indent level by moving
the return -ENODEV to happen before the device register
logic, if the interface is not the audio/video (int 1).
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b8bc77db
......@@ -844,10 +844,13 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
udev = usb_get_dev(interface_to_usbdev(interface));
ifnum = interface->altsetting[0].desc.bInterfaceNumber;
if (ifnum == 1) {
/*
* Interface number 0 - IR interface
* Interface number 0 - IR interface (handled by mceusb driver)
* Interface number 1 - AV interface (handled by this driver)
*/
if (ifnum != 1)
return -ENODEV;
/* Check to see next free device and mark as used */
nr = find_first_zero_bit(&cx231xx_devused, CX231XX_MAXBOARDS);
cx231xx_devused |= 1 << nr;
......@@ -871,8 +874,8 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
dev->devno = nr;
dev->model = id->driver_info;
dev->video_mode.alt = -1;
dev->interface_count++;
dev->interface_count++;
/* reset gpio dir and value */
dev->gpio_dir = 0;
dev->gpio_val = 0;
......@@ -947,9 +950,6 @@ static int cx231xx_usb_probe(struct usb_interface *interface,
"matching IAD interface\n");
return -ENODEV;
}
} else {
return -ENODEV;
}
cx231xx_info("registering interface %d\n", ifnum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment