Commit 220be77c authored by Devin Heitmueller's avatar Devin Heitmueller Committed by Mauro Carvalho Chehab

V4L/DVB (11078): au0828: properly handle non-existent analog inputs

It is not valid to look for dev->board.input == NULL to detect an undefined
analog configuration section, since it is a member of the struct and not a
pointer (hence it will *always* be non-NULL).  Do the check based on whether
the first input is actually a valid input type instead.

Thanks to Michael Krufky <mkrufky@linuxtv.org> for providing sample hardware
of various configurations to test with.
Signed-off-by: default avatarDevin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: default avatarMichael Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent fc4ce6cd
...@@ -195,7 +195,7 @@ void au0828_card_setup(struct au0828_dev *dev) ...@@ -195,7 +195,7 @@ void au0828_card_setup(struct au0828_dev *dev)
break; break;
} }
if (dev->board.input != NULL) { if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
/* Load the analog demodulator driver (note this would need to /* Load the analog demodulator driver (note this would need to
be abstracted out if we ever need to support a different be abstracted out if we ever need to support a different
demod) */ demod) */
......
...@@ -146,7 +146,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface) ...@@ -146,7 +146,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
/* Digital TV */ /* Digital TV */
au0828_dvb_unregister(dev); au0828_dvb_unregister(dev);
if (dev->board.input != NULL) if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
au0828_analog_unregister(dev); au0828_analog_unregister(dev);
/* I2C */ /* I2C */
...@@ -205,7 +205,7 @@ static int au0828_usb_probe(struct usb_interface *interface, ...@@ -205,7 +205,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
au0828_card_setup(dev); au0828_card_setup(dev);
/* Analog TV */ /* Analog TV */
if (dev->board.input != NULL) if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
au0828_analog_register(dev, interface); au0828_analog_register(dev, interface);
/* Digital TV */ /* Digital TV */
......
...@@ -66,7 +66,8 @@ ...@@ -66,7 +66,8 @@
#define AU0828_MAX_INPUT 4 #define AU0828_MAX_INPUT 4
enum au0828_itype { enum au0828_itype {
AU0828_VMUX_COMPOSITE = 1, AU0828_VMUX_UNDEFINED = 0,
AU0828_VMUX_COMPOSITE,
AU0828_VMUX_SVIDEO, AU0828_VMUX_SVIDEO,
AU0828_VMUX_CABLE, AU0828_VMUX_CABLE,
AU0828_VMUX_TELEVISION, AU0828_VMUX_TELEVISION,
......
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