Linux Media Controller development
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Olli Salonen <olli.salonen@iki.fi>, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/2] si2168: return error if set_frontend is called with invalid parameters
Date: Fri, 16 Jan 2015 16:22:54 +0200	[thread overview]
Message-ID: <54B91EBE.1090206@iki.fi> (raw)
In-Reply-To: <1421411720-2364-1-git-send-email-olli.salonen@iki.fi>

On 01/16/2015 02:35 PM, Olli Salonen wrote:
> This patch should is based on Antti's silabs branch.
>
> According to dvb-frontend.h set_frontend may be called with bandwidth_hz set to 0 if automatic bandwidth is required. Si2168 does not support automatic bandwidth and does not declare FE_CAN_BANDWIDTH_AUTO in caps.
>
> This patch will change the behaviour in a way that EINVAL is returned if bandwidth_hz is 0.
>
> Cc-to: Antti Palosaari <crope@iki.fi>
> Signed-off-by: Olli Salonen <olli.salonen@iki.fi>

Reviewed-by: Antti Palosaari <crope@iki.fi>

Antti


> ---
>   drivers/media/dvb-frontends/si2168.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> index 7f966f3..7fef5ab 100644
> --- a/drivers/media/dvb-frontends/si2168.c
> +++ b/drivers/media/dvb-frontends/si2168.c
> @@ -180,7 +180,12 @@ static int si2168_set_frontend(struct dvb_frontend *fe)
>   		goto err;
>   	}
>
> -	if (c->bandwidth_hz <= 5000000)
> +	if (c->bandwidth_hz == 0) {
> +		ret = -EINVAL;
> +		dev_err(&client->dev, "automatic bandwidth not supported");
> +		goto err;
> +	}
> +	else if (c->bandwidth_hz <= 5000000)
>   		bandwidth = 0x05;
>   	else if (c->bandwidth_hz <= 6000000)
>   		bandwidth = 0x06;
>

-- 
http://palosaari.fi/

  parent reply	other threads:[~2015-01-16 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-16 12:35 [PATCH 1/2] si2168: return error if set_frontend is called with invalid parameters Olli Salonen
2015-01-16 12:35 ` [PATCH 2/2] si2168: add support for 1.7MHz bandwidth Olli Salonen
2015-01-16 14:26   ` Antti Palosaari
2015-01-16 14:28   ` Tycho Lürsen
2015-01-16 20:20   ` Prabhakar Lad
2015-01-16 14:22 ` Antti Palosaari [this message]
2015-01-16 14:31 ` [PATCH 1/2] si2168: return error if set_frontend is called with invalid parameters Prabhakar Lad

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=54B91EBE.1090206@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=olli.salonen@iki.fi \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox