Files
erofs-linux/drivers/spi
Santhosh Kumar K 79378db6a8 spi: spi-mem: avoid mutating op template in spi_mem_supports_op()
spi_mem_supports_op() accepts a const struct spi_mem_op pointer but
casts away const internally to call spi_mem_adjust_op_freq(). This
mutates the caller's op template, which causes stale max_freq values
when callers reuse persistent templates - subsequent calls won't
re-apply the device frequency cap since spi_mem_adjust_op_freq()
skips non-zero values.

Fix by operating on a stack-local copy instead.

Fixes: a4f8e70d75 ("spi: spi-mem: add spi_mem_adjust_op_freq() in spi_mem_supports_op()")
Cc: Tianyu Xu <[email protected]>
Cc: [email protected]
Signed-off-by: Santhosh Kumar K <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
2026-05-28 13:49:00 +01:00
..
2026-04-09 19:44:58 +01:00
…
…
…