[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54D09A35.1000500@metafoo.de>
Date: Tue, 03 Feb 2015 10:51:49 +0100
From: Lars-Peter Clausen <lars@...afoo.de>
To: Jean-Michel Hautbois <jean-michel.hautbois@...alys.com>,
hans.verkuil@...co.com, linux-media@...r.kernel.org
CC: linux-kernel@...r.kernel.org, m.chehab@...sung.com,
Pablo Anton <pablo.anton@...alys-labs.com>
Subject: Re: [PATCH] media: i2c: ADV7604: Migrate to regmap
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;
> +}
> +
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists