]> git.baikalelectronics.ru Git - kernel.git/commit
spi: use specific last_cs instead of last_cs_enable
authorYun Zhou <yun.zhou@windriver.com>
Thu, 17 Feb 2022 14:12:34 +0000 (22:12 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 28 Feb 2022 13:36:16 +0000 (13:36 +0000)
commitf965924b8f7dd854db18433838cd14085b7c98c6
tree20f6f83702e1a8ace0991f1e20f2a46946ebc913
parent1737a261f1ebe9947d6ec2789bd16ce583387305
spi: use specific last_cs instead of last_cs_enable

Commit e257b8e50459 instroduced last_cs_enable to avoid setting
chipselect if it's not necessary, but it also introduces a bug. The
chipselect may not be set correctly on multi-device SPI busses. The
reason is that we can't judge the chipselect by bool last_cs_enable,
since chipselect may be modified after other devices were accessed.

So we should record the specific state of chipselect in case of
confusion.

Signed-off-by: Yun Zhou <yun.zhou@windriver.com>
Link: https://lore.kernel.org/r/20220217141234.72737-1-yun.zhou@windriver.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c
include/linux/spi/spi.h