@@ -1212,8 +1212,8 @@ static void ov2740_remove(struct i2c_client *client)
pm_runtime_disable(&client->dev);
}
-static int ov2740_nvmem_read(void *priv, unsigned int off, void *val,
- size_t count)
+static ssize_t ov2740_nvmem_read(void *priv, unsigned int off, void *val,
+ size_t count)
{
struct nvm_data *nvm = priv;
struct device *dev = regmap_get_device(nvm->regmap);
@@ -1241,7 +1241,7 @@ static int ov2740_nvmem_read(void *priv, unsigned int off, void *val,
pm_runtime_put(dev);
exit:
v4l2_subdev_unlock_state(sd_state);
- return ret;
+ return ret < 0 ? ret : count;
}
static int ov2740_register_nvmem(struct i2c_client *client,
Change nvmem read/write function definition return type to ssize_t. Signed-off-by: Joy Chakraborty <joychakr@google.com> --- drivers/media/i2c/ov2740.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)