[PATCH v4 10/27] mtd: spi-nor: swp: Create a helper that writes SR, CR and checks

Pratyush Yadav pratyush at kernel.org
Tue May 5 09:05:11 PDT 2026


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 at bootlin.com>

I'm confused. Doesn't spi_nor_write_16bit_sr_and_check() do the same
thing? How are these two different?

[...]

-- 
Regards,
Pratyush Yadav



More information about the linux-mtd mailing list