Re: [PATCH v4 10/27] mtd: spi-nor: swp: Create a helper that writes SR, CR and checks
From: Pratyush Yadav
Date: Tue May 05 2026 - 12:10:33 EST
On Fri, Apr 03 2026, Miquel Raynal wrote:
> There are many helpers already to either read and/or write SR and/or CR,
> as well as sometimes check the returned values. In order to be able to
> switch from a 1 byte status register to a 2 bytes status register while
> keeping the same level of verification, let's introduce a new helper
> that writes them both (atomically) and then reads them back (separated)
> to compare the values.
>
> In case 2 bytes registers are not supported, we still have the usual
> fallback available in the helper being exported to the rest of the core.
>
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
I'm confused. Doesn't spi_nor_write_16bit_sr_and_check() do the same
thing? How are these two different?
[...]
--
Regards,
Pratyush Yadav