spi_nor_otp_lock_sr2(9)
π spi_nor_otp_lock_sr2(9) β like, the lock the OTP region era π
okay so bestie, we're in the Kernel API Manual today and the main character is spi_nor_otp_lock_sr2. yes it's a mouthful, yes it ate, let's get into it π
β¨ SYNOPSIS β¨
int spi_nor_otp_lock_sr2 (struct spi_nor *nor , unsigned int region );
likeβ¦ that's the whole vibe. two args, one int coming back at you π¦
πΈ ARGUMENTS πΈ
norβ pointer tostruct spi_nor. your flash friend, the whole reason we're here π«Άregionβ the OTP region. the specific little zone we're about to lock up π
π« DESCRIPTION π«
So what does it do? It locks the OTP region by writing the status register-2. that's it, that's the assignment, and it slays π
It's the method used on GigaDevice and Winbond flashes β so if you're on one of those, this is literally your girl β¨
π₯ RETURN π₯
0on success β we love a win π-errnootherwise β tragic, but at least it tells you why π
π§ SEE ALSO π§
Sibling functions, all iconic, all in the kernel file ./drivers/mtd/spi-nor/otp.c:
spi_nor_otp_read_secr(9)spi_nor_otp_write_secr(9)spi_nor_otp_erase_secr(9)spi_nor_otp_is_locked_sr2(9)
go read those too, iykyk π
ngl bestie, this one's short and sweet β but it's doing exactly what it says on the tin, no cap π
and that's the tea β β brought to you by the fine folks over at ./drivers/mtd/spi-nor, October 2026, mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms