lkml.org 
[lkml]   [2020]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] media: ov2740: add NVMEM interface to read customized OTP data
From
Date


On 15/06/2020 10:29, Sakari Ailus wrote:
>> + ret = ov2740_register_nvmem(client);
>> + if (ret)
>> + dev_err(&client->dev, "register nvmem failed, ret %d\n", ret);
>> +
>> /*
>> * Device is already turned on by i2c-core with ACPI domain PM.
>> * Enable runtime PM and turn off the device.
> Could you add #ifdefs for CONFIG_NVMEM so this compiles when it's disabled?

NVMEM already has dummy functions. IMO its better to report an error to
user as the current code does. This will atleast alert the users of
existing nvmem provider that has been disabled!

However with ifdef users have to really look into code to be able to
understand that there is nvmem provider as part of this driver.


Unless you have tight memory restrictions I see no great advantage of
adding #ifdefs

--srini
> It's bool so a simple #ifdef will do. I think ov2740_register_nvmem() could
> have a dummy implementation so this wouldn't litter the probe function.
>
> Thanks.

\
 
 \ /
  Last update: 2020-06-15 11:47    [W:0.146 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site