nvmem: core: set size for sysfs bin file
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 30 Nov 2021 13:39:09 +0000 (13:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Dec 2021 15:03:37 +0000 (16:03 +0100)
For some reason we never set the size for nvmem sysfs binary file.
Set this.

Reported-by: Gilles BULOZ <gilles.buloz@kontron.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20211130133909.6154-1-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/core.c

index e765d3d0542e5962c6e788f71a482072c488491b..23a38dcf0fc4dc8419fbb333e188339b3c7ba4d6 100644 (file)
@@ -312,6 +312,8 @@ static umode_t nvmem_bin_attr_is_visible(struct kobject *kobj,
        struct device *dev = kobj_to_dev(kobj);
        struct nvmem_device *nvmem = to_nvmem_device(dev);
 
+       attr->size = nvmem->size;
+
        return nvmem_bin_attr_get_umode(nvmem);
 }