Re: [PATCH v5 1/1] nvmem: Add support for write-only instances

From: Srinivas Kandagatla
Date: Wed Mar 18 2020 - 12:08:27 EST




On 18/03/2020 15:20, Nicholas Johnson wrote:
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(-)

Applied thanks,

--srini