From: Lars-Peter Clausen <lars@metafoo.de>
To: Jean-Michel Hautbois <jean-michel.hautbois@vodalys.com>,
hans.verkuil@cisco.com, linux-media@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, m.chehab@samsung.com,
Pablo Anton <pablo.anton@vodalys-labs.com>
Subject: Re: [PATCH] media: i2c: ADV7604: Migrate to regmap
Date: Tue, 03 Feb 2015 10:51:49 +0100 [thread overview]
Message-ID: <54D09A35.1000500@metafoo.de> (raw)
In-Reply-To: <1422785339-2699-1-git-send-email-jean-michel.hautbois@vodalys.com>
On 02/01/2015 11:08 AM, Jean-Michel Hautbois wrote:
Looks mostly good, some things in addition to what Hans already said.
[...]
> -
> -static s32 adv_smbus_write_byte_data(struct adv7604_state *state,
> - enum adv7604_page page, u8 command,
> - u8 value)
> +static int regmap_read_check(struct adv7604_state *state,
> + int client_page, u8 reg)
This should have adv rather than regmap prefix.
[...]
> +static int configure_regmap(struct adv7604_state *state, int region)
> +{
> + int err;
> +
> + if (!state->i2c_clients[region])
> + return -ENODEV;
> +
> + if (!state->regmap[region]) {
Given that this function is only called once for each regmap this check
seems unnecessary,
> +
> + state->regmap[region] =
> + devm_regmap_init_i2c(state->i2c_clients[region],
> + &adv76xx_regmap[region]);
> +
> + if (IS_ERR(state->regmap[region])) {
> + err = PTR_ERR(state->regmap[region]);
> + v4l_err(state->i2c_clients[region],
> + "Error initializing regmap %d with error %d\n",
> + region, err);
> + return -EINVAL;
> + }
> + }
> +
> + return 0;
> +}
> +
[...]
prev parent reply other threads:[~2015-02-03 9:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-01 10:08 [PATCH] media: i2c: ADV7604: Migrate to regmap Jean-Michel Hautbois
2015-02-02 10:44 ` Hans Verkuil
2015-02-03 10:05 ` Hans Verkuil
2015-02-03 9:51 ` Lars-Peter Clausen [this message]
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=54D09A35.1000500@metafoo.de \
--to=lars@metafoo.de \
--cc=hans.verkuil@cisco.com \
--cc=jean-michel.hautbois@vodalys.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=pablo.anton@vodalys-labs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).