Commit 5a9abae4 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] af9035: enhancement for unknown tuner ID handling

* 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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7f882c2e
...@@ -489,10 +489,9 @@ static int af9035_read_mac_address(struct dvb_usb_device *d, u8 mac[6]) ...@@ -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; af9035_af9033_config[i].spec_inv = 1;
break; break;
default: default:
warn("tuner ID=%20x not supported, please report!", af9035_config.hw_not_supported = true;
warn("tuner ID=%02x not supported, please report!",
tmp); tmp);
ret = -ENODEV;
goto err;
}; };
/* tuner IF frequency */ /* tuner IF frequency */
...@@ -535,6 +534,11 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -535,6 +534,11 @@ static int af9035_frontend_attach(struct dvb_usb_adapter *adap)
{ {
int ret; int ret;
if (af9035_config.hw_not_supported) {
ret = -ENODEV;
goto err;
}
if (adap->id == 0) { if (adap->id == 0) {
ret = af9035_wr_reg(adap->dev, 0x00417f, ret = af9035_wr_reg(adap->dev, 0x00417f,
af9035_af9033_config[1].i2c_addr); af9035_af9033_config[1].i2c_addr);
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#ifndef AF9035_H #ifndef AF9035_H
#define AF9035_H #define AF9035_H
/* prefix for dvb-usb log writings */
#define DVB_USB_LOG_PREFIX "af9035"
#include "dvb-usb.h" #include "dvb-usb.h"
struct reg_val { struct reg_val {
...@@ -46,6 +49,7 @@ struct usb_req { ...@@ -46,6 +49,7 @@ struct usb_req {
struct config { struct config {
bool dual_mode; bool dual_mode;
bool hw_not_supported;
}; };
struct fw_segment { struct fw_segment {
......
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