]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] af9035: enhancement for unknown tuner ID handling
authorAntti Palosaari <crope@iki.fi>
Fri, 30 Mar 2012 20:15:16 +0000 (17:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Apr 2012 17:43:01 +0000 (14:43 -0300)
* do not attach frontend when tuner is not supported
* fix unkown tuner ID log write format
* add prefix for dvb-usb log writings

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/af9035.c
drivers/media/dvb/dvb-usb/af9035.h

index 6606cf52ea985cbfd8b8365609c57c40769310eb..b8cd27ae161b674dc74fa062b07f3dd1158bfc0b 100644 (file)
@@ -489,10 +489,9 @@ static int af9035_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
                        af9035_af9033_config[i].spec_inv = 1;
                        break;
                default:
-                       warn("tuner ID=%20x not supported, please report!",
+                       af9035_config.hw_not_supported = true;
+                       warn("tuner ID=%02x not supported, please report!",
                                tmp);
-                       ret = -ENODEV;
-                       goto err;
                };
 
                /* tuner IF frequency */
@@ -535,6 +534,11 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
 {
        int ret;
 
+       if (af9035_config.hw_not_supported) {
+               ret = -ENODEV;
+               goto err;
+       }
+
        if (adap->id == 0) {
                ret = af9035_wr_reg(adap->dev, 0x00417f,
                                af9035_af9033_config[1].i2c_addr);
index b9af9c81e44c2fa6c7bcdb9d8369c7c5ea49f211..0df24cdf2504484ec297059b2aad71f6a5b3105e 100644 (file)
@@ -22,6 +22,9 @@
 #ifndef AF9035_H
 #define AF9035_H
 
+/* prefix for dvb-usb log writings */
+#define DVB_USB_LOG_PREFIX "af9035"
+
 #include "dvb-usb.h"
 
 struct reg_val {
@@ -46,6 +49,7 @@ struct usb_req {
 
 struct config {
        bool dual_mode;
+       bool hw_not_supported;
 };
 
 struct fw_segment {