V4L/DVB (4650): Misc fixes for dib0700 download

Several fixes for dib0700-module. (Firmware error checking, dependency)

Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig
index 135f287..67cefdd 100644
--- a/drivers/media/dvb/dvb-usb/Kconfig
+++ b/drivers/media/dvb/dvb-usb/Kconfig
@@ -70,6 +70,7 @@
 	tristate "DiBcom DiB0700 USB DVB devices (see help for supported devices)"
 	depends on DVB_USB
 	select DVB_DIB7000M
+	select DVB_DIB3000MC
 	select DVB_TUNER_MT2060
 	help
 	  Support for USB2.0/1.1 DVB receivers based on the DiB0700 USB bridge. The
diff --git a/drivers/media/dvb/dvb-usb/dib0700_core.c b/drivers/media/dvb/dvb-usb/dib0700_core.c
index 75e8570..a1a8165a 100644
--- a/drivers/media/dvb/dvb-usb/dib0700_core.c
+++ b/drivers/media/dvb/dvb-usb/dib0700_core.c
@@ -138,8 +138,6 @@
 		buf[0], USB_TYPE_VENDOR | USB_DIR_OUT, 0, 0, buf, 3, USB_CTRL_GET_TIMEOUT) != 3;
 
 	deb_info("cold: %d\n", *cold);
-
-	*cold = 0;
 	return 0;
 }
 
@@ -171,11 +169,11 @@
 	u8 buf[260];
 
 	while ((ret = dvb_usb_get_hexline(fw, &hx, &pos)) > 0) {
-		deb_fwdata("writing to address 0x%04x (buffer: 0x%02x %02x)\n",hx.addr, hx.len, hx.chk);
+		deb_fwdata("writing to address 0x%08x (buffer: 0x%02x %02x)\n",hx.addr, hx.len, hx.chk);
 
 		buf[0] = hx.len;
-		buf[1] = hx.addr >> 8;
-		buf[2] = hx.addr & 0xff;
+		buf[1] = (hx.addr >> 8) & 0xff;
+		buf[2] =  hx.addr       & 0xff;
 		buf[3] = hx.type;
 		memcpy(&buf[4],hx.data,hx.len);
 		buf[4+hx.len] = hx.chk;
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
index 4e986f1..e1112e3 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-firmware.c
@@ -80,7 +80,6 @@
 	int ret;
 	const struct firmware *fw = NULL;
 
-
 	if ((ret = request_firmware(&fw, props->firmware, &udev->dev)) != 0) {
 		err("did not find the firmware file. (%s) "
 			"Please see linux/Documentation/dvb/ for more details on firmware-problems. (%d)",
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index 6babdcd..0dd90d1 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -228,7 +228,7 @@
 	if (cold) {
 		info("found a '%s' in cold state, will try to load a firmware",desc->name);
 		ret = dvb_usb_download_firmware(udev,props);
-		if (!props->no_reconnect)
+		if (!props->no_reconnect || ret != 0)
 			return ret;
 	}