]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mem: Add extra sanity checks on the op param
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 20 Sep 2018 07:31:12 +0000 (09:31 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 20 Sep 2018 19:24:00 +0000 (12:24 -0700)
commitca740735542ad8f19c3daa0644d04cf2ead806b2
tree4c8e3116c6204deadac7fc7506d7bcfdf6ffee41
parent777cb2037a4bf07660ed611e5313613c98c02b86
spi: spi-mem: Add extra sanity checks on the op param

Some combinations are simply not valid and should be rejected before
the op is passed to the SPI controller driver.

Add an spi_mem_check_op() helper and use it in spi_mem_exec_op() and
spi_mem_supports_op() to make sure the spi-mem operation is valid.

Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c