There is at least one real-world use-case for write-only nvmem
instances. Refer to 03cd45d2e219 ("thunderbolt: Prevent crash if
non-active NVMem file is read").
Add support for write-only nvmem instances by adding attrs for 0200.
Change nvmem_register() to abort if NULL group is returned from
nvmem_sysfs_get_groups().
Return NULL from nvmem_sysfs_get_groups() in invalid cases.
Signed-off-by: Nicholas Johnson<nicholas.johnson-opensource@xxxxxxxxxxxxxx>
---
drivers/nvmem/core.c | 10 +++++--
drivers/nvmem/nvmem-sysfs.c | 56 +++++++++++++++++++++++++++++++------
2 files changed, 56 insertions(+), 10 deletions(-)