Lines Matching refs:count
56 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size) in w1_f23_fix_count() argument
61 if ((off + count) > size) in w1_f23_fix_count()
64 return count; in w1_f23_fix_count()
98 loff_t off, size_t count) in eeprom_read() argument
108 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_read()
116 max_page = (off + count - 1) >> W1_PAGE_BITS; in eeprom_read()
119 count = -EIO; in eeprom_read()
123 memcpy(buf, &data->memory[off], count); in eeprom_read()
129 count = -EIO; in eeprom_read()
137 w1_read_block(sl->master, buf, count); in eeprom_read()
144 return count; in eeprom_read()
212 loff_t off, size_t count) in eeprom_write() argument
217 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_write()
222 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) { in eeprom_write()
224 (int)off, count); in eeprom_write()
229 for (idx = 0; idx < count; idx += W1_PAGE_SIZE) { in eeprom_write()
241 while (idx < count) { in eeprom_write()
244 if (len > (count - idx)) in eeprom_write()
245 len = count - idx; in eeprom_write()
248 count = -EIO; in eeprom_write()
257 return count; in eeprom_write()