Commit eb176cb4 authored by Miquel Raynal's avatar Miquel Raynal Committed by Greg Kroah-Hartman
Browse files

nvmem: core: Notify when a new layout is registered

parent b9740091
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -771,12 +771,16 @@ int __nvmem_layout_register(struct nvmem_layout *layout, struct module *owner)
	list_add(&layout->node, &nvmem_layouts);
	spin_unlock(&nvmem_layout_lock);

	blocking_notifier_call_chain(&nvmem_notifier, NVMEM_LAYOUT_ADD, layout);

	return 0;
}
EXPORT_SYMBOL_GPL(__nvmem_layout_register);

void nvmem_layout_unregister(struct nvmem_layout *layout)
{
	blocking_notifier_call_chain(&nvmem_notifier, NVMEM_LAYOUT_REMOVE, layout);

	spin_lock(&nvmem_layout_lock);
	list_del(&layout->node);
	spin_unlock(&nvmem_layout_lock);
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ enum {
	NVMEM_REMOVE,
	NVMEM_CELL_ADD,
	NVMEM_CELL_REMOVE,
	NVMEM_LAYOUT_ADD,
	NVMEM_LAYOUT_REMOVE,
};

#if IS_ENABLED(CONFIG_NVMEM)