From: Antti Palosaari <crope@iki.fi>
To: Benjamin Larsson <benjamin@southpole.se>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 4/4] mn88472: implemented ber reporting
Date: Sat, 13 Dec 2014 06:15:09 +0200 [thread overview]
Message-ID: <548BBD4D.3060001@iki.fi> (raw)
In-Reply-To: <1418429925-16342-4-git-send-email-benjamin@southpole.se>
On 12/13/2014 02:18 AM, Benjamin Larsson wrote:
> Signed-off-by: Benjamin Larsson <benjamin@southpole.se>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Even I could accept that, as a staging driver, I see there some issues:
* missing commit message (ok, it is trivial and patch subject says)
* it is legacy DVBv3 API BER reporting, whilst driver is DVBv5 mostly
due to DVB-T2... So DVBv5 statistics are preferred.
* dynamic debugs has unneded __func__, see
Documentation/dynamic-debug-howto.txt
* there should be spaces used around binary and ternary calculation
operators, see Documentation/CodingStyle for more info how it should be.
Could you read overall these two docs before make new patches:
Documentation/CodingStyle
Documentation/dynamic-debug-howto.txt
also use scripts/checkpatch.pl to verify patch, like that
git diff | ./scripts/checkpatch.pl -
regards
Antti
> ---
> drivers/staging/media/mn88472/mn88472.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c
> index 746cc94..8b35639 100644
> --- a/drivers/staging/media/mn88472/mn88472.c
> +++ b/drivers/staging/media/mn88472/mn88472.c
> @@ -392,6 +392,36 @@ err:
> return ret;
> }
>
> +static int mn88472_read_ber(struct dvb_frontend *fe, u32 *ber)
> +{
> + struct i2c_client *client = fe->demodulator_priv;
> + struct mn88472_dev *dev = i2c_get_clientdata(client);
> + int ret, err, len;
> + u8 data[3];
> +
> + dev_dbg(&client->dev, "%s:\n", __func__);
> +
> + ret = regmap_bulk_read(dev->regmap[0], 0x9F , data, 3);
> + if (ret)
> + goto err;
> + err = data[0]<<16 | data[1]<<8 | data[2];
> +
> + ret = regmap_bulk_read(dev->regmap[0], 0xA2 , data, 2);
> + if (ret)
> + goto err;
> + len = data[0]<<8 | data[1];
> +
> + if (len)
> + *ber = (err*100)/len;
> + else
> + *ber = 0;
> +
> + return 0;
> +err:
> + dev_dbg(&client->dev, "%s: failed=%d\n", __func__, ret);
> + return ret;
> +}
> +
> static struct dvb_frontend_ops mn88472_ops = {
> .delsys = {SYS_DVBT, SYS_DVBT2, SYS_DVBC_ANNEX_A},
> .info = {
> @@ -425,6 +455,7 @@ static struct dvb_frontend_ops mn88472_ops = {
> .set_frontend = mn88472_set_frontend,
>
> .read_status = mn88472_read_status,
> + .read_ber = mn88472_read_ber,
> };
>
> static int mn88472_probe(struct i2c_client *client,
>
--
http://palosaari.fi/
next prev parent reply other threads:[~2014-12-13 4:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-13 0:18 [PATCH 1/4] mn88472: implement dvb-t signal lock Benjamin Larsson
2014-12-13 0:18 ` [PATCH 2/4] rtl28xxu: swap frontend order for devices with slave demodulators Benjamin Larsson
2014-12-13 4:02 ` Antti Palosaari
2014-12-13 11:09 ` Benjamin Larsson
2014-12-13 13:35 ` Antti Palosaari
2014-12-13 18:52 ` Benjamin Larsson
2014-12-14 8:05 ` Antti Palosaari
2014-12-14 19:17 ` Benjamin Larsson
2014-12-13 0:18 ` [PATCH 3/4] mn88472: elaborate debug printout Benjamin Larsson
2014-12-13 4:05 ` Antti Palosaari
2014-12-13 0:18 ` [PATCH 4/4] mn88472: implemented ber reporting Benjamin Larsson
2014-12-13 4:15 ` Antti Palosaari [this message]
2014-12-13 11:12 ` Benjamin Larsson
2014-12-14 8:35 ` Antti Palosaari
2014-12-13 3:52 ` [PATCH 1/4] mn88472: implement dvb-t signal lock Antti Palosaari
2014-12-13 11:13 ` Benjamin Larsson
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=548BBD4D.3060001@iki.fi \
--to=crope@iki.fi \
--cc=benjamin@southpole.se \
--cc=linux-media@vger.kernel.org \
/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.