summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/au0828
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:01:01 -0400
committerDevin Heitmueller <dheitmueller@linuxtv.org>2009-03-11 02:01:01 -0400
commit3f7bd4e3eef22d1416780db3ae3300c16bc21961 (patch)
tree187b6a24a87d379e0aaa84d9a1de894002828b79 /linux/drivers/media/video/au0828
parent954299a93e6d076c844770136c359f48049b3d88 (diff)
downloadmediapointer-dvb-s2-3f7bd4e3eef22d1416780db3ae3300c16bc21961.tar.gz
mediapointer-dvb-s2-3f7bd4e3eef22d1416780db3ae3300c16bc21961.tar.bz2
au0828: properly handle non-existent analog inputs
From: Devin Heitmueller <dheitmueller@linuxtv.org> 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. Priority: normal Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org> Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video/au0828')
-rw-r--r--linux/drivers/media/video/au0828/au0828-cards.c2
-rw-r--r--linux/drivers/media/video/au0828/au0828-core.c4
-rw-r--r--linux/drivers/media/video/au0828/au0828.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/linux/drivers/media/video/au0828/au0828-cards.c b/linux/drivers/media/video/au0828/au0828-cards.c
index e10b1b922..0516c0608 100644
--- a/linux/drivers/media/video/au0828/au0828-cards.c
+++ b/linux/drivers/media/video/au0828/au0828-cards.c
@@ -195,7 +195,7 @@ void au0828_card_setup(struct au0828_dev *dev)
break;
}
- if (dev->board.input != NULL) {
+ if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED) {
/* Load the analog demodulator driver (note this would need to
be abstracted out if we ever need to support a different
demod) */
diff --git a/linux/drivers/media/video/au0828/au0828-core.c b/linux/drivers/media/video/au0828/au0828-core.c
index 3e1ce6080..a477c8587 100644
--- a/linux/drivers/media/video/au0828/au0828-core.c
+++ b/linux/drivers/media/video/au0828/au0828-core.c
@@ -147,7 +147,7 @@ static void au0828_usb_disconnect(struct usb_interface *interface)
/* Digital TV */
au0828_dvb_unregister(dev);
- if (dev->board.input != NULL)
+ if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
au0828_analog_unregister(dev);
/* I2C */
@@ -206,7 +206,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
au0828_card_setup(dev);
/* Analog TV */
- if (dev->board.input != NULL)
+ if (AUVI_INPUT(0).type != AU0828_VMUX_UNDEFINED)
au0828_analog_register(dev, interface);
/* Digital TV */
diff --git a/linux/drivers/media/video/au0828/au0828.h b/linux/drivers/media/video/au0828/au0828.h
index d2e54c8e1..590d15e46 100644
--- a/linux/drivers/media/video/au0828/au0828.h
+++ b/linux/drivers/media/video/au0828/au0828.h
@@ -66,7 +66,8 @@
#define AU0828_MAX_INPUT 4
enum au0828_itype {
- AU0828_VMUX_COMPOSITE = 1,
+ AU0828_VMUX_UNDEFINED = 0,
+ AU0828_VMUX_COMPOSITE,
AU0828_VMUX_SVIDEO,
AU0828_VMUX_CABLE,
AU0828_VMUX_TELEVISION,