Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvmem: core: Notify when a new layout is registered

Tell listeners a new layout was introduced and is now available.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20230823132744.350618-23-srinivas.kandagatla@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Miquel Raynal and committed by
Greg Kroah-Hartman
eb176cb4 b9740091

+6
+4
drivers/nvmem/core.c
··· 771 771 list_add(&layout->node, &nvmem_layouts); 772 772 spin_unlock(&nvmem_layout_lock); 773 773 774 + blocking_notifier_call_chain(&nvmem_notifier, NVMEM_LAYOUT_ADD, layout); 775 + 774 776 return 0; 775 777 } 776 778 EXPORT_SYMBOL_GPL(__nvmem_layout_register); 777 779 778 780 void nvmem_layout_unregister(struct nvmem_layout *layout) 779 781 { 782 + blocking_notifier_call_chain(&nvmem_notifier, NVMEM_LAYOUT_REMOVE, layout); 783 + 780 784 spin_lock(&nvmem_layout_lock); 781 785 list_del(&layout->node); 782 786 spin_unlock(&nvmem_layout_lock);
+2
include/linux/nvmem-consumer.h
··· 43 43 NVMEM_REMOVE, 44 44 NVMEM_CELL_ADD, 45 45 NVMEM_CELL_REMOVE, 46 + NVMEM_LAYOUT_ADD, 47 + NVMEM_LAYOUT_REMOVE, 46 48 }; 47 49 48 50 #if IS_ENABLED(CONFIG_NVMEM)