From: Ulf Hansson Date: Thu, 26 Apr 2018 08:53:10 +0000 (+0200) Subject: spi: Respect all error codes from dev_pm_domain_attach() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=71f277a7bf0b0e65e9571940057c70efc4326bc5;p=openwrt%2Fstaging%2Fblogic.git spi: Respect all error codes from dev_pm_domain_attach() The limitation of being able to check only for -EPROBE_DEFER from dev_pm_domain_attach() has been removed. Hence let's respect all error codes and bail out accordingly. Signed-off-by: Ulf Hansson Acked-by: Mark Brown Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 7b213faa0a2b..eeab67f50580 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -356,11 +356,12 @@ static int spi_drv_probe(struct device *dev) } ret = dev_pm_domain_attach(dev, true); - if (ret != -EPROBE_DEFER) { - ret = sdrv->probe(spi); - if (ret) - dev_pm_domain_detach(dev, true); - } + if (ret) + return ret; + + ret = sdrv->probe(spi); + if (ret) + dev_pm_domain_detach(dev, true); return ret; }