Lines Matching +full:non +full:- +full:negative
1 // SPDX-License-Identifier: GPL-2.0
18 * tb_nvm_alloc() - Allocate new NVM structure
31 return ERR_PTR(-ENOMEM); in tb_nvm_alloc()
39 nvm->id = ret; in tb_nvm_alloc()
40 nvm->dev = dev; in tb_nvm_alloc()
46 * tb_nvm_add_active() - Adds active NVMem device to NVM
55 * Returns %0 in success and negative errno otherwise.
67 config.id = nvm->id; in tb_nvm_add_active()
71 config.dev = nvm->dev; in tb_nvm_add_active()
79 nvm->active = nvmem; in tb_nvm_add_active()
84 * tb_nvm_write_buf() - Write data to @nvm buffer
91 * written to the flash. Copies @bytes from @val to @nvm->buf starting
97 if (!nvm->buf) { in tb_nvm_write_buf()
98 nvm->buf = vmalloc(NVM_MAX_SIZE); in tb_nvm_write_buf()
99 if (!nvm->buf) in tb_nvm_write_buf()
100 return -ENOMEM; in tb_nvm_write_buf()
103 nvm->flushed = false; in tb_nvm_write_buf()
104 nvm->buf_data_size = offset + bytes; in tb_nvm_write_buf()
105 memcpy(nvm->buf + offset, val, bytes); in tb_nvm_write_buf()
110 * tb_nvm_add_non_active() - Adds non-active NVMem device to NVM
112 * @size: Size of the non-active NVM in bytes
116 * Registers new non-active NVmem device for @nvm. The @reg_write is called
119 * Returns %0 in success and negative errno otherwise.
132 config.id = nvm->id; in tb_nvm_add_non_active()
136 config.dev = nvm->dev; in tb_nvm_add_non_active()
144 nvm->non_active = nvmem; in tb_nvm_add_non_active()
149 * tb_nvm_free() - Release NVM and its resources
157 if (nvm->non_active) in tb_nvm_free()
158 nvmem_unregister(nvm->non_active); in tb_nvm_free()
159 if (nvm->active) in tb_nvm_free()
160 nvmem_unregister(nvm->active); in tb_nvm_free()
161 vfree(nvm->buf); in tb_nvm_free()
162 ida_simple_remove(&nvm_ida, nvm->id); in tb_nvm_free()