All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: "Rémi Cardona" <remi.cardona@smartjog.com>
Cc: linux-media@vger.kernel.org, liplianin@me.by
Subject: Re: [PATCH 5/6] [media] ds3000: properly report firmware probing issues
Date: Sun, 16 Sep 2012 04:44:40 +0300	[thread overview]
Message-ID: <50552F08.1080401@iki.fi> (raw)
In-Reply-To: <1347614846-19046-6-git-send-email-remi.cardona@smartjog.com>

On 09/14/2012 12:27 PM, Rémi Cardona wrote:
> ds3000_readreg() returns negative values in case of i2c failures. The
> old code would simply return 0 when failing to read the 0xb2 register,
> misleading ds3000_initfe() into believing that the firmware had been
> correctly loaded.
>
> Also print out a message if the chip says a firmware is already loaded.
> This should make it more obvious if the chip is in a weird state.
>
> Signed-off-by: Rémi Cardona <remi.cardona@smartjog.com>

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

I still suggest to use pr_info() / dev_info() instead of 
printk(KERN_INFO...).

Also printing "Firmware already uploaded, skipping" *every time* when 
device is opened is not wise.


> ---
>   drivers/media/dvb/frontends/ds3000.c |    8 +++++++-
>   1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c
> index 162faaf..970963c 100644
> --- a/drivers/media/dvb/frontends/ds3000.c
> +++ b/drivers/media/dvb/frontends/ds3000.c
> @@ -395,8 +395,14 @@ static int ds3000_firmware_ondemand(struct dvb_frontend *fe)
>
>   	dprintk("%s()\n", __func__);
>
> -	if (ds3000_readreg(state, 0xb2) <= 0)
> +	ret = ds3000_readreg(state, 0xb2);
> +	if (ret == 0) {
> +		printk(KERN_INFO "%s: Firmware already uploaded, skipping\n",
> +			__func__);
>   		return ret;
> +	} else if (ret < 0) {
> +		return ret;
> +	}
>
>   	/* Load firmware */
>   	/* request the firmware, this will block until someone uploads it */
>

regards
Antti

-- 
http://palosaari.fi/

  reply	other threads:[~2012-09-16  1:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14  9:27 [PATCH v2 0/6] ds3000 improvements Rémi Cardona
2012-09-14  9:27 ` [PATCH 1/6] [media] ds3000: Declare MODULE_FIRMWARE usage Rémi Cardona
2012-09-16  1:27   ` Antti Palosaari
2012-09-14  9:27 ` [PATCH 2/6] [media] ds3000: remove useless 'locking' Rémi Cardona
2012-09-16  1:28   ` Antti Palosaari
2012-09-14  9:27 ` [PATCH 3/6] [media] ds3000: properly report register read errors Rémi Cardona
2012-09-16  1:30   ` Antti Palosaari
2012-09-14  9:27 ` [PATCH 4/6] [media] ds3000: bail out early on i2c failures during firmware load Rémi Cardona
2012-09-16  1:41   ` Antti Palosaari
2012-09-14  9:27 ` [PATCH 5/6] [media] ds3000: properly report firmware probing issues Rémi Cardona
2012-09-16  1:44   ` Antti Palosaari [this message]
2012-09-14  9:27 ` [PATCH 6/6] [media] ds3000: add module parameter to force firmware upload Rémi Cardona
2012-09-16  1:45   ` Antti Palosaari
2012-09-16  1:26 ` [PATCH v2 0/6] ds3000 improvements Antti Palosaari
2012-09-17 12:54   ` Rémi Cardona

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=50552F08.1080401@iki.fi \
    --to=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=liplianin@me.by \
    --cc=remi.cardona@smartjog.com \
    /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.