V4L/DVB (11070): au0828: Rework the way the analog video binding occurs

Rework the way boards are managed so that we can change the board description
based on the Hauppauge eeprom (modeled after cx88-cards.c).

Also, make sure that we don't load the analog stack if there are no analog
inputs defined in the board profile.

Thanks to Michael Krufky <mkrufky@linuxtv.org> for providing information on
the various ways different Hauppauge boards can be configured.

Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/video/au0828/au0828-core.c b/drivers/media/video/au0828/au0828-core.c
index 680e88f6..0bc85b7 100644
--- a/drivers/media/video/au0828/au0828-core.c
+++ b/drivers/media/video/au0828/au0828-core.c
@@ -146,7 +146,8 @@
 	/* Digital TV */
 	au0828_dvb_unregister(dev);
 
-	au0828_analog_unregister(dev);
+	if (dev->board.input != NULL)
+		au0828_analog_unregister(dev);
 
 	/* I2C */
 	au0828_i2c_unregister(dev);
@@ -189,7 +190,7 @@
 	mutex_init(&dev->mutex);
 	mutex_init(&dev->dvb.lock);
 	dev->usbdev = usbdev;
-	dev->board = id->driver_info;
+	dev->boardnr = id->driver_info;
 
 	usb_set_intfdata(interface, dev);
 
@@ -230,14 +231,14 @@
 	au0828_card_setup(dev);
 
 	/* Analog TV */
-	au0828_analog_register(dev);
+	if (dev->board.input != NULL)
+		au0828_analog_register(dev);
 
 	/* Digital TV */
 	au0828_dvb_register(dev);
 
 	printk(KERN_INFO "Registered device AU0828 [%s]\n",
-		au0828_boards[dev->board].name == NULL ? "Unset" :
-		au0828_boards[dev->board].name);
+		dev->board.name == NULL ? "Unset" : dev->board.name);
 
 	return 0;
 }