@@ -755,13 +755,13 @@ static int spi_nor_xread_sr(struct spi_nor *nor, u8 *sr)
755755}
756756
757757/**
758- * s3an_sr_ready () - Query the Status Register of the S3AN flash to see if the
759- * flash is ready for new commands.
758+ * spi_nor_xsr_ready () - Query the Status Register of the S3AN flash to see if
759+ * the flash is ready for new commands.
760760 * @nor: pointer to 'struct spi_nor'.
761761 *
762762 * Return: 0 on success, -errno otherwise.
763763 */
764- static int s3an_sr_ready (struct spi_nor * nor )
764+ static int spi_nor_xsr_ready (struct spi_nor * nor )
765765{
766766 int ret ;
767767
@@ -892,7 +892,7 @@ static int spi_nor_ready(struct spi_nor *nor)
892892 int sr , fsr ;
893893
894894 if (nor -> flags & SNOR_F_READY_XSR_RDY )
895- sr = s3an_sr_ready (nor );
895+ sr = spi_nor_xsr_ready (nor );
896896 else
897897 sr = spi_nor_sr_ready (nor );
898898 if (sr < 0 )
@@ -1784,8 +1784,8 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
17841784 return ret ;
17851785}
17861786
1787- static void stm_get_locked_range (struct spi_nor * nor , u8 sr , loff_t * ofs ,
1788- uint64_t * len )
1787+ static void spi_nor_get_locked_range_sr (struct spi_nor * nor , u8 sr , loff_t * ofs ,
1788+ uint64_t * len )
17891789{
17901790 struct mtd_info * mtd = & nor -> mtd ;
17911791 u8 mask = SR_BP2 | SR_BP1 | SR_BP0 ;
@@ -1813,16 +1813,16 @@ static void stm_get_locked_range(struct spi_nor *nor, u8 sr, loff_t *ofs,
18131813 * Return 1 if the entire region is locked (if @locked is true) or unlocked (if
18141814 * @locked is false); 0 otherwise
18151815 */
1816- static int stm_check_lock_status_sr (struct spi_nor * nor , loff_t ofs , uint64_t len ,
1817- u8 sr , bool locked )
1816+ static int spi_nor_check_lock_status_sr (struct spi_nor * nor , loff_t ofs ,
1817+ uint64_t len , u8 sr , bool locked )
18181818{
18191819 loff_t lock_offs ;
18201820 uint64_t lock_len ;
18211821
18221822 if (!len )
18231823 return 1 ;
18241824
1825- stm_get_locked_range (nor , sr , & lock_offs , & lock_len );
1825+ spi_nor_get_locked_range_sr (nor , sr , & lock_offs , & lock_len );
18261826
18271827 if (locked )
18281828 /* Requested range is a sub-range of locked range */
@@ -1832,16 +1832,16 @@ static int stm_check_lock_status_sr(struct spi_nor *nor, loff_t ofs, uint64_t le
18321832 return (ofs >= lock_offs + lock_len ) || (ofs + len <= lock_offs );
18331833}
18341834
1835- static int stm_is_locked_sr (struct spi_nor * nor , loff_t ofs , uint64_t len ,
1836- u8 sr )
1835+ static int spi_nor_is_locked_sr (struct spi_nor * nor , loff_t ofs , uint64_t len ,
1836+ u8 sr )
18371837{
1838- return stm_check_lock_status_sr (nor , ofs , len , sr , true);
1838+ return spi_nor_check_lock_status_sr (nor , ofs , len , sr , true);
18391839}
18401840
1841- static int stm_is_unlocked_sr (struct spi_nor * nor , loff_t ofs , uint64_t len ,
1842- u8 sr )
1841+ static int spi_nor_is_unlocked_sr (struct spi_nor * nor , loff_t ofs , uint64_t len ,
1842+ u8 sr )
18431843{
1844- return stm_check_lock_status_sr (nor , ofs , len , sr , false);
1844+ return spi_nor_check_lock_status_sr (nor , ofs , len , sr , false);
18451845}
18461846
18471847/*
@@ -1876,7 +1876,7 @@ static int stm_is_unlocked_sr(struct spi_nor *nor, loff_t ofs, uint64_t len,
18761876 *
18771877 * Returns negative on errors, 0 on success.
18781878 */
1879- static int stm_lock (struct spi_nor * nor , loff_t ofs , uint64_t len )
1879+ static int spi_nor_sr_lock (struct spi_nor * nor , loff_t ofs , uint64_t len )
18801880{
18811881 struct mtd_info * mtd = & nor -> mtd ;
18821882 int ret , status_old , status_new ;
@@ -1894,16 +1894,16 @@ static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len)
18941894 status_old = nor -> bouncebuf [0 ];
18951895
18961896 /* If nothing in our range is unlocked, we don't need to do anything */
1897- if (stm_is_locked_sr (nor , ofs , len , status_old ))
1897+ if (spi_nor_is_locked_sr (nor , ofs , len , status_old ))
18981898 return 0 ;
18991899
19001900 /* If anything below us is unlocked, we can't use 'bottom' protection */
1901- if (!stm_is_locked_sr (nor , 0 , ofs , status_old ))
1901+ if (!spi_nor_is_locked_sr (nor , 0 , ofs , status_old ))
19021902 can_be_bottom = false;
19031903
19041904 /* If anything above us is unlocked, we can't use 'top' protection */
1905- if (!stm_is_locked_sr (nor , ofs + len , mtd -> size - (ofs + len ),
1906- status_old ))
1905+ if (!spi_nor_is_locked_sr (nor , ofs + len , mtd -> size - (ofs + len ),
1906+ status_old ))
19071907 can_be_top = false;
19081908
19091909 if (!can_be_bottom && !can_be_top )
@@ -1958,11 +1958,11 @@ static int stm_lock(struct spi_nor *nor, loff_t ofs, uint64_t len)
19581958}
19591959
19601960/*
1961- * Unlock a region of the flash. See stm_lock () for more info
1961+ * Unlock a region of the flash. See spi_nor_sr_lock () for more info
19621962 *
19631963 * Returns negative on errors, 0 on success.
19641964 */
1965- static int stm_unlock (struct spi_nor * nor , loff_t ofs , uint64_t len )
1965+ static int spi_nor_sr_unlock (struct spi_nor * nor , loff_t ofs , uint64_t len )
19661966{
19671967 struct mtd_info * mtd = & nor -> mtd ;
19681968 int ret , status_old , status_new ;
@@ -1980,16 +1980,16 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len)
19801980 status_old = nor -> bouncebuf [0 ];
19811981
19821982 /* If nothing in our range is locked, we don't need to do anything */
1983- if (stm_is_unlocked_sr (nor , ofs , len , status_old ))
1983+ if (spi_nor_is_unlocked_sr (nor , ofs , len , status_old ))
19841984 return 0 ;
19851985
19861986 /* If anything below us is locked, we can't use 'top' protection */
1987- if (!stm_is_unlocked_sr (nor , 0 , ofs , status_old ))
1987+ if (!spi_nor_is_unlocked_sr (nor , 0 , ofs , status_old ))
19881988 can_be_top = false;
19891989
19901990 /* If anything above us is locked, we can't use 'bottom' protection */
1991- if (!stm_is_unlocked_sr (nor , ofs + len , mtd -> size - (ofs + len ),
1992- status_old ))
1991+ if (!spi_nor_is_unlocked_sr (nor , ofs + len , mtd -> size - (ofs + len ),
1992+ status_old ))
19931993 can_be_bottom = false;
19941994
19951995 if (!can_be_bottom && !can_be_top )
@@ -2046,27 +2046,27 @@ static int stm_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len)
20462046}
20472047
20482048/*
2049- * Check if a region of the flash is (completely) locked. See stm_lock() for
2050- * more info.
2049+ * Check if a region of the flash is (completely) locked. See spi_nor_sr_lock()
2050+ * for more info.
20512051 *
20522052 * Returns 1 if entire region is locked, 0 if any portion is unlocked, and
20532053 * negative on errors.
20542054 */
2055- static int stm_is_locked (struct spi_nor * nor , loff_t ofs , uint64_t len )
2055+ static int spi_nor_sr_is_locked (struct spi_nor * nor , loff_t ofs , uint64_t len )
20562056{
20572057 int ret ;
20582058
20592059 ret = spi_nor_read_sr (nor , nor -> bouncebuf );
20602060 if (ret )
20612061 return ret ;
20622062
2063- return stm_is_locked_sr (nor , ofs , len , nor -> bouncebuf [0 ]);
2063+ return spi_nor_is_locked_sr (nor , ofs , len , nor -> bouncebuf [0 ]);
20642064}
20652065
2066- static const struct spi_nor_locking_ops stm_locking_ops = {
2067- .lock = stm_lock ,
2068- .unlock = stm_unlock ,
2069- .is_locked = stm_is_locked ,
2066+ static const struct spi_nor_locking_ops spi_nor_sr_locking_ops = {
2067+ .lock = spi_nor_sr_lock ,
2068+ .unlock = spi_nor_sr_unlock ,
2069+ .is_locked = spi_nor_sr_is_locked ,
20702070};
20712071
20722072static int spi_nor_lock (struct mtd_info * mtd , loff_t ofs , uint64_t len )
@@ -4895,7 +4895,7 @@ static void spi_nor_late_init_params(struct spi_nor *nor)
48954895 * the default ones.
48964896 */
48974897 if (nor -> flags & SNOR_F_HAS_LOCK && !nor -> params .locking_ops )
4898- nor -> params .locking_ops = & stm_locking_ops ;
4898+ nor -> params .locking_ops = & spi_nor_sr_locking_ops ;
48994899}
49004900
49014901/**
0 commit comments