[linux-dvb] [PATCH] cx24123: do not scare people with wrong error message
Fabio M. Di Nitto
fabbione at fabbione.net
Tue Dec 9 23:28:17 CET 2008
Hi guys,
very first submission to this project.. please be nice ;)
(some people MUA's have the bad habit to trash inline patches.. here is an
extra copy: http://www.fabbione.net/cx24123.diff)
Thanks
Fabio
# HG changeset patch
# User Fabio M. Di Nitto <fabbione at fabbione.net>
# Date 1228860803 -3600
# Node ID f60c6b537d850bdb4fb052a39f4e72cafb8c3a6f
# Parent 77f789d59de83e2d29af77967cffd1aa0730fa2b
cx24123: do not scare people with wrong error message
From: Fabio M. Di Nitto <fabbione at fabbione.net>
"CX24123: wrong demod revision: 87" is printed even if no CX24123
is detected on the board.
Add a return code check to the i2c call and print a less scary
message.
Priority: low
Signed-off-by: Fabio M. Di Nitto <fabbione at fabbione.net>
diff -r 77f789d59de8 -r f60c6b537d85 linux/drivers/media/dvb/frontends/cx24123.c
--- a/linux/drivers/media/dvb/frontends/cx24123.c Tue Dec 09 16:43:10 2008 -0200
+++ b/linux/drivers/media/dvb/frontends/cx24123.c Tue Dec 09 23:13:23 2008 +0100
@@ -1084,6 +1084,7 @@
struct dvb_frontend *cx24123_attach(const struct cx24123_config *config,
struct i2c_adapter *i2c)
{
+ int rc;
struct cx24123_state *state =
kzalloc(sizeof(struct cx24123_state), GFP_KERNEL);
@@ -1099,7 +1100,12 @@
state->i2c = i2c;
/* check if the demod is there */
- state->demod_rev = cx24123_readreg(state, 0x00);
+ rc = cx24123_readreg(state, 0x00);
+ if (rc < 0) {
+ info("CX24123/CX24123C not detected\n");
+ goto error;
+ }
+ state->demod_rev = rc;
switch (state->demod_rev) {
case 0xe1:
info("detected CX24123C\n");
--
I'm going to make him an offer he can't refuse.
More information about the linux-dvb
mailing list