diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 294d0038eea6..0d40953b463c 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3269,6 +3269,15 @@ int spi_setup(struct spi_device *spi) status); return status; } + + /* + * We do not want to return positive value from pm_runtime_get, + * there are many instances of devices calling spi_setup() and + * checking for a non-zero return value instead of a negative + * return value. + */ + status = 0; + spi_set_cs(spi, false); pm_runtime_mark_last_busy(spi->controller->dev.parent); pm_runtime_put_autosuspend(spi->controller->dev.parent);