Lines Matching refs:nvs
42 int nvs_read ( struct nvs_device *nvs, unsigned int address, in nvs_read() argument
50 assert ( ( len & ( ( 1 << nvs->word_len_log2 ) - 1 ) ) == 0 ); in nvs_read()
55 frag_len = ( ( nvs->block_size - in nvs_read()
56 ( address & ( nvs->block_size - 1 ) ) ) in nvs_read()
57 << nvs->word_len_log2 ); in nvs_read()
64 if ( ( rc = nvs->read ( nvs, address, data, frag_len ) ) != 0 ) in nvs_read()
69 address += ( frag_len >> nvs->word_len_log2 ); in nvs_read()
85 static int nvs_verify ( struct nvs_device *nvs, unsigned int address, in nvs_verify() argument
91 if ( ( rc = nvs_read ( nvs, address, read_data, len ) ) != 0 ) in nvs_verify()
97 nvs, address, len ); in nvs_verify()
113 int nvs_write ( struct nvs_device *nvs, unsigned int address, in nvs_write() argument
121 assert ( ( len & ( ( 1 << nvs->word_len_log2 ) - 1 ) ) == 0 ); in nvs_write()
126 frag_len = ( ( nvs->block_size - in nvs_write()
127 ( address & ( nvs->block_size - 1 ) ) ) in nvs_write()
128 << nvs->word_len_log2 ); in nvs_write()
135 if ( ( rc = nvs->write ( nvs, address, data, frag_len ) ) != 0) in nvs_write()
139 if ( ( rc = nvs_verify ( nvs, address, data, frag_len ) ) != 0) in nvs_write()
144 address += ( frag_len >> nvs->word_len_log2 ); in nvs_write()