From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: linuxtv@stefanringel.de
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 03/22] mt2063: add hybrid
Date: Mon, 19 Mar 2012 21:03:31 -0300 [thread overview]
Message-ID: <4F67C953.3040109@redhat.com> (raw)
In-Reply-To: <1329256066-8844-3-git-send-email-linuxtv@stefanringel.de>
Em 14-02-2012 19:47, linuxtv@stefanringel.de escreveu:
> From: Stefan Ringel <linuxtv@stefanringel.de>
>
> Signed-off-by: Stefan Ringel <linuxtv@stefanringel.de>
Patch is broken:
drivers/media/common/tuners/mt2063.c:365:1: error: expected identifier or ‘(’ before ‘{’ token
drivers/media/common/tuners/mt2063.c:367:4: error: expected identifier or ‘(’ before ‘else’
drivers/media/common/tuners/mt2063.c:369:1: error: expected identifier or ‘(’ before ‘}’ token
drivers/media/common/tuners/mt2063.c:371:1: error: expected identifier or ‘(’ before ‘{’ token
drivers/media/common/tuners/mt2063.c:287:12: warning: ‘mt2063_setreg’ defined but not used [-Wunused-function]
drivers/media/common/tuners/mt2063.c:308:12: warning: ‘mt2063_read’ defined but not used [-Wunused-function]
drivers/media/common/tuners/mt2063.c:355:12: warning: ‘MT2063_Sleep’ defined but not used [-Wunused-function]
> ---
> drivers/media/common/tuners/mt2063.c | 57 +++++++++++++++++++++++-----------
> 1 files changed, 39 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/media/common/tuners/mt2063.c b/drivers/media/common/tuners/mt2063.c
> index 9f3a546..d5a9dd9 100644
> --- a/drivers/media/common/tuners/mt2063.c
> +++ b/drivers/media/common/tuners/mt2063.c
> @@ -32,6 +32,8 @@ static unsigned int debug;
> module_param(debug, int, 0644);
> MODULE_PARM_DESC(debug, "Set debug level");
>
> +static DEFINE_MUTEX(mt2063_list_mutex);
> +static LIST_HEAD(hybrid_tuner_instance_list);
>
> /* debug level
> * 0 don't debug
> @@ -2247,29 +2249,48 @@ static struct dvb_tuner_ops mt2063_ops = {
> };
>
> struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe,
> - struct mt2063_config *config,
> - struct i2c_adapter *i2c)
> + struct mt2063_config *config,
> + struct i2c_adapter *i2c)
> {
> struct mt2063_state *state = NULL;
> + int instance, ret;
> +
> + dprintk(1, "\n");
> +
> + mutex_lock(&mt2063_list_mutex);
> +
> + instance = hybrid_tuner_request_state(struct mt2063_state, state,
> + hybrid_tuner_instance_list,
> + i2c, config->tuner_address,
> + "mt2063");
> +
> + switch(instance) {
> + case 0:
> + goto fail;
> + case 1:
> + /* new instance */
> + state->i2c = i2c;
> + state->i2c_addr = config->tuner_address;
> + /* find chip */
> + mutex_init(&state->lock);
> + state->frontend = fe;
> + if (ret < 0)
> + goto fail;
> + fe->tuner_priv = state;
> + fe->ops.tuner_ops = mt2063_ops;
> + break;
> + default:
> + fe->tuner_priv = state;
> + fe->ops.tuner_ops = mt2063_ops;
> + break;
> + }
> + mutex_unlock(&mt2063_list_mutex);
>
> - dprintk(2, "\n");
> -
> - state = kzalloc(sizeof(struct mt2063_state), GFP_KERNEL);
> - if (state == NULL)
> - goto error;
> -
> - state->config = config;
> - state->i2c = i2c;
> - state->frontend = fe;
> - state->reference = config->refclock / 1000; /* kHz */
> - fe->tuner_priv = state;
> - fe->ops.tuner_ops = mt2063_ops;
> -
> - printk(KERN_INFO "%s: Attaching MT2063\n", __func__);
> return fe;
>
> -error:
> - kfree(state);
> +fail:
> + hybrid_tuner_release_state(state);
> + mutex_unlock(&mt2063_list_mutex);
> return NULL;
> }
> EXPORT_SYMBOL_GPL(mt2063_attach);
next prev parent reply other threads:[~2012-03-20 0:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 21:47 [PATCH 01/22] mt2063: trivial change linuxtv
2012-02-14 21:47 ` [PATCH 02/22] mt2063: remove unused functions linuxtv
2012-02-14 21:47 ` [PATCH 03/22] mt2063: add hybrid linuxtv
2012-03-20 0:03 ` Mauro Carvalho Chehab [this message]
2012-02-14 21:47 ` [PATCH 04/22] mt2063: remove dect linuxtv
2012-03-20 0:08 ` Mauro Carvalho Chehab
2012-02-14 21:47 ` [PATCH 05/22] mt2063: remove spurcheck linuxtv
2012-03-20 0:09 ` Mauro Carvalho Chehab
2012-02-14 21:47 ` [PATCH 06/22] mt2063: remove remove up + down converter linuxtv
2012-02-14 21:47 ` [PATCH 07/22] mt2063: read_reg, write_reg linuxtv
2012-02-14 21:47 ` [PATCH 08/22] mt2063: add shutdown linuxtv
2012-02-14 21:47 ` [PATCH 09/22] mt2063: move global setting into a header file linuxtv
2012-02-14 21:47 ` [PATCH 10/22] mt2063: new set_mode linuxtv
2012-02-14 21:47 ` [PATCH 11/22] mt2063: remove get_bandwidth linuxtv
2012-02-14 21:47 ` [PATCH 12/22] mt2063: remove LockStatus linuxtv
2012-02-14 21:47 ` [PATCH 13/22] mt2063: new tune function linuxtv
2012-02-14 21:47 ` [PATCH 14/22] mt2063: remove get_status linuxtv
2012-02-14 21:47 ` [PATCH 15/22] mt_2063: add mt2063_sleep linuxtv
2012-02-14 21:47 ` [PATCH 16/22] mt2063: add hybrid stuff in release function linuxtv
2012-02-14 21:47 ` [PATCH 17/22] mt2063: chane set_analog_params linuxtv
2012-02-14 21:47 ` [PATCH 18/22] mt2063: add get_if_frequency linuxtv
2012-02-14 21:47 ` [PATCH 19/22] mt2063: remove old get_if_frequency linuxtv
2012-02-14 21:47 ` [PATCH 20/22] mt2063: change set_params function linuxtv
2012-02-14 21:47 ` [PATCH 21/22] mt2063: change mt2063_init linuxtv
2012-02-14 21:47 ` [PATCH 22/22] mt2063: add mt2063_find_chip linuxtv
2012-03-20 0:02 ` [PATCH 01/22] mt2063: trivial change Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F67C953.3040109@redhat.com \
--to=mchehab@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=linuxtv@stefanringel.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.