diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2013-06-10 12:22:26 -0400 |
---|---|---|
committer | Mark Brown <broonielinaro.org> | 2013-06-10 13:04:00 -0400 |
commit | 6c6cf64b16438eac6da9a90412a82316ad196e7c (patch) | |
tree | f9d8ef9eeb87dd9fd868ec1ac7f460ae8ee30b26 | |
parent | 317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff) |
spi: s3c64xx: Fix pm_runtime_get_sync() return value check
If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.
Without this patch there are seen errors like:
[ 8.540000] s3c64xx-spi 13930000.spi: Failed to enable device: 1
[ 8.545000] spi_master spi1: failed to prepare transfer hardware
Likely because the driver uses synchronous API to runtime enable
the device and asynchronous one to disable it.
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mark Brown <broonielinaro.org>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/spi/spi-s3c64xx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 5000586cb98d..71cc3e6ef47c 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c | |||
@@ -444,7 +444,7 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi) | |||
444 | } | 444 | } |
445 | 445 | ||
446 | ret = pm_runtime_get_sync(&sdd->pdev->dev); | 446 | ret = pm_runtime_get_sync(&sdd->pdev->dev); |
447 | if (ret != 0) { | 447 | if (ret < 0) { |
448 | dev_err(dev, "Failed to enable device: %d\n", ret); | 448 | dev_err(dev, "Failed to enable device: %d\n", ret); |
449 | goto out_tx; | 449 | goto out_tx; |
450 | } | 450 | } |