• S
    nvmem: core: rework nvmem cell instance creation · 7ae6478b
    Srinivas Kandagatla 提交于
    In the existing design, we do not create a instance per nvmem cell consumer
    but we directly refer cell from nvmem cell list that are added to provider.
    
    However this design has some limitations when consumers want to assign name
    or connection id the nvmem cell instance, ex: via "nvmem-cell-names" or
    id in nvmem_cell_get(id).
    
    Having a name associated with nvmem cell consumer instance will help
    provider drivers in performing post processing of nvmem cell data if required
    before data is seen by the consumers. This is pretty normal with some vendors
    storing nvmem cells like mac-address in a vendor specific data layouts that
    are not directly usable by the consumer drivers.
    
    With this patch nvmem cell will be created dynamically during nvmem_cell_get
    and destroyed in nvmem_cell_put, allowing consumers to associate name with
    nvmem cell consumer instance.
    
    With this patch a new struct nvmem_cell_entry replaces struct nvmem_cell
    for storing nvmem cell information within the core.
    This patch does not change nvmem-consumer interface based on nvmem_cell.
    Tested-by: NJoakim Zhang <qiangqing.zhang@nxp.com>
    Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
    Link: https://lore.kernel.org/r/20211013131957.30271-2-srinivas.kandagatla@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    7ae6478b
core.c 44.8 KB