[PATCH 3/6] [DVB] mt312 DVB frontend update

From: LinuxTV.org CVS maintainer (hunold@convergence.de)
Date: Tue Jul 29 2003 - 04:30:31 EST


[DVB] - show i2c read errors only for registered frontends
diff -uNrwB --new-file linux-2.6.0-test2.work/drivers/media/dvb/frontends/mt312.c linux-2.6.0-test2.patch/drivers/media/dvb/frontends/mt312.c
--- linux-2.6.0-test2.work/drivers/media/dvb/frontends/mt312.c 2003-07-29 09:10:18.000000000 +0200
+++ linux-2.6.0-test2.patch/drivers/media/dvb/frontends/mt312.c 2003-07-29 09:17:53.000000000 +0200
@@ -41,6 +41,9 @@
 #define MT312_SYS_CLK 90000000UL /* 90 MHz */
 #define MT312_PLL_CLK 10000000UL /* 10 MHz */
 
+/* number of active frontends */
+static int mt312_count = 0;
+
 static struct dvb_frontend_info mt312_info = {
         .name = "Zarlink MT312",
         .type = FE_QPSK,
@@ -78,7 +81,7 @@
 
         ret = i2c->xfer(i2c, msg, 2);
 
- if (ret != 2) {
+ if ((ret != 2) && (mt312_count != 0)) {
                 printk(KERN_ERR "%s: ret == %d\n", __FUNCTION__, ret);
                 return -EREMOTEIO;
         }
@@ -722,13 +725,21 @@
         if ((id != ID_VP310) && (id != ID_MT312))
                 return -ENODEV;
 
- return dvb_register_frontend(mt312_ioctl, i2c, (void *) (long) id,
- &mt312_info);
+ if ((ret = dvb_register_frontend(mt312_ioctl, i2c,
+ (void *)(long)id, &mt312_info)) < 0)
+ return ret;
+
+ mt312_count++;
+
+ return 0;
 }
 
 static void mt312_detach(struct dvb_i2c_bus *i2c)
 {
         dvb_unregister_frontend(mt312_ioctl, i2c);
+
+ if (mt312_count)
+ mt312_count--;
 }
 
 static int __init mt312_module_init(void)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:39 EST