aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/tda1004x.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index 49973846373e..3993d1ce334a 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -1248,11 +1248,14 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
1248 struct i2c_adapter* i2c) 1248 struct i2c_adapter* i2c)
1249{ 1249{
1250 struct tda1004x_state *state; 1250 struct tda1004x_state *state;
1251 u8 id;
1251 1252
1252 /* allocate memory for the internal state */ 1253 /* allocate memory for the internal state */
1253 state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); 1254 state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
1254 if (!state) 1255 if (!state) {
1256 printk(KERN_ERR "Can't alocate memory for tda10045 state\n");
1255 return NULL; 1257 return NULL;
1258 }
1256 1259
1257 /* setup the state */ 1260 /* setup the state */
1258 state->config = config; 1261 state->config = config;
@@ -1260,7 +1263,9 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
1260 state->demod_type = TDA1004X_DEMOD_TDA10045; 1263 state->demod_type = TDA1004X_DEMOD_TDA10045;
1261 1264
1262 /* check if the demod is there */ 1265 /* check if the demod is there */
1263 if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x25) { 1266 id = tda1004x_read_byte(state, TDA1004X_CHIPID);
1267 if (id != 0x25) {
1268 printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
1264 kfree(state); 1269 kfree(state);
1265 return NULL; 1270 return NULL;
1266 } 1271 }
@@ -1307,11 +1312,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
1307 struct i2c_adapter* i2c) 1312 struct i2c_adapter* i2c)
1308{ 1313{
1309 struct tda1004x_state *state; 1314 struct tda1004x_state *state;
1315 u8 id;
1310 1316
1311 /* allocate memory for the internal state */ 1317 /* allocate memory for the internal state */
1312 state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL); 1318 state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
1313 if (!state) 1319 if (!state) {
1320 printk(KERN_ERR "Can't alocate memory for tda10046 state\n");
1314 return NULL; 1321 return NULL;
1322 }
1315 1323
1316 /* setup the state */ 1324 /* setup the state */
1317 state->config = config; 1325 state->config = config;
@@ -1319,7 +1327,9 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
1319 state->demod_type = TDA1004X_DEMOD_TDA10046; 1327 state->demod_type = TDA1004X_DEMOD_TDA10046;
1320 1328
1321 /* check if the demod is there */ 1329 /* check if the demod is there */
1322 if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x46) { 1330 id = tda1004x_read_byte(state, TDA1004X_CHIPID);
1331 if (id != 0x46) {
1332 printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
1323 kfree(state); 1333 kfree(state);
1324 return NULL; 1334 return NULL;
1325 } 1335 }