public inbox for linux-media@vger.kernel.org
 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 v3 5/6] si2168: add I2C error handling
Date: Thu, 07 May 2015 23:49:44 +0300	[thread overview]
Message-ID: <554BCFE8.6020200@iki.fi> (raw)
In-Reply-To: <1430658023-17579-3-git-send-email-olli.salonen@iki.fi>

Moikka!
I didn't make any tests, but I could guess that error flag is set by 
firmware when some unsupported / invalid parameter is given as a 
firmware command request.

Anyhow, I am not sure which is proper error code to return. Could you 
please study, check from API docs and so, which are suitable error 
codes. EINVAL sounds proper code, but imho it is not good as generally 
it is returned by driver when invalid parameters are requested and I 
would like to see some other code to make difference (between driver and 
firmware error).

regards
Antti


On 05/03/2015 04:00 PM, Olli Salonen wrote:
> Return error from si2168_cmd_execute in case the demodulator returns an
> error.
>
> Signed-off-by: Olli Salonen <olli.salonen@iki.fi>
> ---
>   drivers/media/dvb-frontends/si2168.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
> index 29a5936..b68ab34 100644
> --- a/drivers/media/dvb-frontends/si2168.c
> +++ b/drivers/media/dvb-frontends/si2168.c
> @@ -60,6 +60,12 @@ static int si2168_cmd_execute(struct i2c_client *client, struct si2168_cmd *cmd)
>   				jiffies_to_msecs(jiffies) -
>   				(jiffies_to_msecs(timeout) - TIMEOUT));
>
> +		/* error bit set? */
> +		if ((cmd->args[0] >> 6) & 0x01) {
> +			ret = -EREMOTEIO;
> +			goto err_mutex_unlock;
> +		}
> +
>   		if (!((cmd->args[0] >> 7) & 0x01)) {
>   			ret = -ETIMEDOUT;
>   			goto err_mutex_unlock;
>

-- 
http://palosaari.fi/

  reply	other threads:[~2015-05-07 20:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-03 13:00 [PATCH v3 3/6] si2157: support selection of IF interface Olli Salonen
2015-05-03 13:00 ` [PATCH v3 4/6] rtl28xxu: add I2C read without write Olli Salonen
2015-05-03 13:00 ` [PATCH v3 5/6] si2168: add I2C error handling Olli Salonen
2015-05-07 20:49   ` Antti Palosaari [this message]
2015-05-07 23:36     ` Olli Salonen
2015-05-03 13:00 ` [PATCH v3 6/6] rtl2832: add support for GoTView MasterHD 3 USB tuner Olli Salonen

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=554BCFE8.6020200@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