On Tue, Nov 22, 2011 at 5:34 AM, Andreas Oberritter <o...@linuxtv.org> wrote:
> On 21.11.2011 22:06, Manu Abraham wrote:
>>
>> 0004-TDA18271-Allow-frontend-to-set-DELSYS-rather-than-qu.patch
>>
>>
>> From 2ece38602678ae323450d0e35379147e6e086326 Mon Sep 17 00:00:00 2001
>> From: Manu Abraham <abraham.m...@gmail.com>
>> Date: Sat, 19 Nov 2011 19:50:09 +0530
>> Subject: [PATCH 04/13] TDA18271: Allow frontend to set DELSYS, rather than 
>> querying fe->ops.info.type
>>
>> With any tuner that can tune to multiple delivery systems/standards, it does
>> query fe->ops.info.type to determine frontend type and set the delivery
>> system type. fe->ops.info.type can handle only 4 delivery systems, viz 
>> FE_QPSK,
>> FE_QAM, FE_OFDM and FE_ATSC.
>>
>> The change allows the tuner to be set to any delivery system specified in
>> fe_delivery_system_t, thereby simplifying a lot of issues.
>>
>> Signed-off-by: Manu Abraham <abraham.m...@gmail.com>
>> ---
>>  drivers/media/common/tuners/tda18271-fe.c   |   80 
>> +++++++++++++++++++++++++++
>>  drivers/media/common/tuners/tda18271-priv.h |    2 +
>>  2 files changed, 82 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/media/common/tuners/tda18271-fe.c 
>> b/drivers/media/common/tuners/tda18271-fe.c
>> index 3347c5b..6e29faf 100644
>> --- a/drivers/media/common/tuners/tda18271-fe.c
>> +++ b/drivers/media/common/tuners/tda18271-fe.c
>> @@ -928,6 +928,85 @@ fail:
>>
>>  /* ------------------------------------------------------------------ */
>>
>> +static int tda18271_set_state(struct dvb_frontend *fe,
>> +                           enum tuner_param param,
>> +                           struct tuner_state *state)
>> +{
>> +     struct tda18271_priv *priv = fe->tuner_priv;
>> +     struct tuner_state *req = &priv->request;
>> +     struct tda18271_std_map *std_map = &priv->std;
>> +     struct tda18271_std_map_item *map;
>> +     int ret;
>> +
>> +     BUG_ON(!priv);
>
> At this point priv has already been dereferenced.


True, that check is useless.

>
>> +     if (param & DVBFE_TUNER_DELSYS)
>> +             req->delsys = state->delsys;
>> +     if (param & DVBFE_TUNER_FREQUENCY)
>> +             req->frequency = state->frequency;
>> +     if (param & DVBFE_TUNER_BANDWIDTH)
>> +             req->bandwidth = state->bandwidth;
>
> What happens if one of these flags is not set, when the function is
> called for the first time? priv->request doesn't seem to get initialized.

Request needs to be evaluated, whether it is a valid request for the
tuner operation. Need to fix.


Thanks,
Manu
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to