mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
spi: Make spi_delay_exec() warn if called from atomic context
If the delay used is long enough the spi_delay_exec() will use a sleeping function to implement it. Add a might_sleep() here to help avoid callers using this from an atomic context and running into problems at runtime on other systems. Suggested-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Signed-off-by: Mark Brown <broonie@kernel.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20200522155005.46099-1-broonie@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
36f8f189b8
commit
8fede89f85
@ -1160,6 +1160,8 @@ int spi_delay_exec(struct spi_delay *_delay, struct spi_transfer *xfer)
|
|||||||
{
|
{
|
||||||
int delay;
|
int delay;
|
||||||
|
|
||||||
|
might_sleep();
|
||||||
|
|
||||||
if (!_delay)
|
if (!_delay)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user