diff options
author | Andrew de Quincey <adq_dvb@lidskialf.net> | 2006-08-08 09:10:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-09-26 11:53:23 -0300 |
commit | 13fef9335f4fe2a73e1733f8807e69711736faef (patch) | |
tree | 499ccb23b708e265517388cfce80d4b25a2e315d /drivers/media/dvb/frontends/lnbp21.c | |
parent | 94cbae5a1a1537ef5a402199f597e84dc5dd92cb (diff) |
V4L/DVB (4383): Convert SEC drivers to new frontend API
Convert SEC drivers to new frontend API
Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Acked-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/lnbp21.c')
-rw-r--r-- | drivers/media/dvb/frontends/lnbp21.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/media/dvb/frontends/lnbp21.c b/drivers/media/dvb/frontends/lnbp21.c index e933edc8dd2..37bba32f29a 100644 --- a/drivers/media/dvb/frontends/lnbp21.c +++ b/drivers/media/dvb/frontends/lnbp21.c @@ -40,12 +40,11 @@ struct lnbp21 { u8 override_or; u8 override_and; struct i2c_adapter *i2c; - void (*release_chain)(struct dvb_frontend* fe); }; static int lnbp21_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) { - struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->misc_priv; + struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->sec_priv; struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = &lnbp21->config, .len = sizeof(lnbp21->config) }; @@ -73,7 +72,7 @@ static int lnbp21_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) { - struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->misc_priv; + struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->sec_priv; struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = &lnbp21->config, .len = sizeof(lnbp21->config) }; @@ -91,29 +90,24 @@ static int lnbp21_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg) static void lnbp21_release(struct dvb_frontend *fe) { - struct lnbp21 *lnbp21 = (struct lnbp21 *) fe->misc_priv; - /* LNBP power off */ lnbp21_set_voltage(fe, SEC_VOLTAGE_OFF); - /* free data & call next release routine */ - fe->ops.release = lnbp21->release_chain; - kfree(fe->misc_priv); - fe->misc_priv = NULL; - if (fe->ops.release) - fe->ops.release(fe); + /* free data */ + kfree(fe->sec_priv); + fe->sec_priv = NULL; } -int lnbp21_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear) +struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_set, u8 override_clear) { struct lnbp21 *lnbp21 = kmalloc(sizeof(struct lnbp21), GFP_KERNEL); if (!lnbp21) - return -ENOMEM; + return NULL; /* default configuration */ lnbp21->config = LNBP21_ISEL; lnbp21->i2c = i2c; - fe->misc_priv = lnbp21; + fe->sec_priv = lnbp21; /* bits which should be forced to '1' */ lnbp21->override_or = override_set; @@ -124,19 +118,17 @@ int lnbp21_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 override_ /* detect if it is present or not */ if (lnbp21_set_voltage(fe, SEC_VOLTAGE_OFF)) { kfree(lnbp21); - fe->misc_priv = NULL; - return -EIO; + return NULL; } /* install release callback */ - lnbp21->release_chain = fe->ops.release; fe->ops.release = lnbp21_release; /* override frontend ops */ fe->ops.set_voltage = lnbp21_set_voltage; fe->ops.enable_high_lnb_voltage = lnbp21_enable_high_lnb_voltage; - return 0; + return fe; } EXPORT_SYMBOL(lnbp21_attach); |