mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
media: ov2740: move regmap_config to a static const variable
This one was fully static, so no need to fill it in the register function manually. Signed-off-by: Link Mauve <linkmauve@linkmauve.fr> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
parent
665cf662a0
commit
eeafd9e121
|
|
@ -1241,11 +1241,16 @@ static int ov2740_nvmem_read(void *priv, unsigned int off, void *val,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static const struct regmap_config regmap_config = {
|
||||
.val_bits = 8,
|
||||
.reg_bits = 16,
|
||||
.disable_locking = true,
|
||||
};
|
||||
|
||||
static int ov2740_register_nvmem(struct i2c_client *client,
|
||||
struct ov2740 *ov2740)
|
||||
{
|
||||
struct nvm_data *nvm;
|
||||
struct regmap_config regmap_config = { };
|
||||
struct regmap *regmap;
|
||||
struct device *dev = ov2740->dev;
|
||||
struct nvmem_config nvmem_config = {
|
||||
|
|
@ -1266,9 +1271,6 @@ static int ov2740_register_nvmem(struct i2c_client *client,
|
|||
if (!nvm)
|
||||
return -ENOMEM;
|
||||
|
||||
regmap_config.val_bits = 8;
|
||||
regmap_config.reg_bits = 16;
|
||||
regmap_config.disable_locking = true;
|
||||
regmap = devm_regmap_init_i2c(client, ®map_config);
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user