Skip to content

Commit

Permalink
spi: s3c64xx: Fix pm_runtime_get_sync() return value check
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Sylwester Nawrocki authored and Mark Brown committed Jun 10, 2013
1 parent 317ddd2 commit 6c6cf64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ static int s3c64xx_spi_prepare_transfer(struct spi_master *spi)
}

ret = pm_runtime_get_sync(&sdd->pdev->dev);
if (ret != 0) {
if (ret < 0) {
dev_err(dev, "Failed to enable device: %d\n", ret);
goto out_tx;
}
Expand Down

0 comments on commit 6c6cf64

Please sign in to comment.