Lines Matching defs:off
54 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size)
56 if (off > size)
59 if ((off + count) > size)
60 return (size - off);
70 int off = block * W1_PAGE_SIZE;
81 wrbuf[1] = off & 0xff;
82 wrbuf[2] = off >> 8;
84 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE);
87 if (crc16(CRC16_INIT, &data->memory[off], W1_PAGE_SIZE) == CRC16_VALID)
94 static ssize_t w1_f23_read_bin(struct kobject *kobj, char *buf, loff_t off,
105 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
112 min_page = (off >> W1_PAGE_BITS);
113 max_page = (off + count - 1) >> W1_PAGE_BITS;
120 memcpy(buf, &data->memory[off], count);
131 wrbuf[1] = off & 0xff;
132 wrbuf[2] = off >> 8;
202 static ssize_t w1_f23_write_bin(struct kobject *kobj, char *buf, loff_t off,
208 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0)
213 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) {
214 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n",
215 (int)off, count);
222 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off);
233 addr = off + idx;