Lines Matching refs:ofs

403 static void stm_get_locked_range(struct spi_nor *nor, u8 sr, loff_t *ofs,  in stm_get_locked_range()  argument
413 *ofs = 0; in stm_get_locked_range()
418 *ofs = mtd->size - *len; in stm_get_locked_range()
425 static int stm_is_locked_sr(struct spi_nor *nor, loff_t ofs, uint64_t len, in stm_is_locked_sr() argument
433 return (ofs + len <= lock_offs + lock_len) && (ofs >= lock_offs); in stm_is_locked_sr()
459 static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len) in stm_lock() argument
469 if (ofs + len != mtd->size) { in stm_lock()
471 if (!stm_is_locked_sr(nor, ofs + len, mtd->size - ofs - len, in stm_lock()
474 len = mtd->size - ofs; in stm_lock()
509 static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len) in stm_unlock() argument
519 if (stm_is_locked_sr(nor, ofs - mtd->erasesize, mtd->erasesize, in stm_unlock()
532 pow = ilog2(mtd->size) - order_base_2(mtd->size - (ofs + len)); in stm_unlock()
533 if (ofs + len == mtd->size) { in stm_unlock()
559 static int stm_is_locked(struct spi_nor *nor, loff_t ofs, uint64_t len) in stm_is_locked() argument
567 return stm_is_locked_sr(nor, ofs, len, status); in stm_is_locked()
570 static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) in spi_nor_lock() argument
579 ret = nor->flash_lock(nor, ofs, len); in spi_nor_lock()
585 static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) in spi_nor_unlock() argument
594 ret = nor->flash_unlock(nor, ofs, len); in spi_nor_unlock()
600 static int spi_nor_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) in spi_nor_is_locked() argument
609 ret = nor->flash_is_locked(nor, ofs, len); in spi_nor_is_locked()