diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index bb3066cedb7e..cbcb40924824 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3119,6 +3119,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);