On Sun Jul 26 14:45:30 2026 +0200, Link Mauve wrote:
> This also removes initializing reg_write to NULL, which will help with
> changing its signature in nvmem-provider[1].
>
> Thanks to Sakari Ailus for their suggestion[2]!
>
> [1]
> https://lore.kernel.org/rust-for-linux/[email protected]/
> [2]
> https://lore.kernel.org/rust-for-linux/[email protected]/
>
> Signed-off-by: Link Mauve <[email protected]>
> Suggested-by: Sakari Ailus <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>
Patch committed.
Thanks,
Sakari Ailus
drivers/media/i2c/ov2740.c | 27 +++++++++++++--------------
1 file changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c
index fb590dfadda1..fbcbadcecebe 100644
--- a/drivers/media/i2c/ov2740.c
+++ b/drivers/media/i2c/ov2740.c
@@ -1246,9 +1246,21 @@ static int ov2740_register_nvmem(struct i2c_client
*client,
{
struct nvm_data *nvm;
struct regmap_config regmap_config = { };
- struct nvmem_config nvmem_config = { };
struct regmap *regmap;
struct device *dev = ov2740->dev;
+ struct nvmem_config nvmem_config = {
+ .name = dev_name(dev),
+ .dev = dev,
+ .read_only = true,
+ .root_only = true,
+ .owner = THIS_MODULE,
+ .compat = true,
+ .base_dev = dev,
+ .reg_read = ov2740_nvmem_read,
+ .stride = 1,
+ .word_size = 1,
+ .size = CUSTOMER_USE_OTP_SIZE,
+ };
nvm = devm_kzalloc(dev, sizeof(*nvm), GFP_KERNEL);
if (!nvm)
@@ -1262,20 +1274,7 @@ static int ov2740_register_nvmem(struct i2c_client
*client,
return PTR_ERR(regmap);
nvm->regmap = regmap;
-
- nvmem_config.name = dev_name(dev);
- nvmem_config.dev = dev;
- nvmem_config.read_only = true;
- nvmem_config.root_only = true;
- nvmem_config.owner = THIS_MODULE;
- nvmem_config.compat = true;
- nvmem_config.base_dev = dev;
- nvmem_config.reg_read = ov2740_nvmem_read;
- nvmem_config.reg_write = NULL;
nvmem_config.priv = nvm;
- nvmem_config.stride = 1;
- nvmem_config.word_size = 1;
- nvmem_config.size = CUSTOMER_USE_OTP_SIZE;
nvm->nvmem = devm_nvmem_register(dev, &nvmem_config);
if (IS_ERR(nvm->nvmem))
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]