From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: broonie@opensource.wolfsonmicro.com
Cc: grant.likely@linaro.org, linux-kernel@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH] spi: s3c64xx: Fix pm_runtime_get_sync() return value check
Date: Mon, 10 Jun 2013 18:10:46 +0200 [thread overview]
Message-ID: <51B5FA86.5090705@samsung.com> (raw)
In-Reply-To: <1369666560-12436-1-git-send-email-s.nawrocki@samsung.com>
On 05/27/2013 04:56 PM, Sylwester Nawrocki wrote:
> 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 asychronous one to disable it.
Is there anything wrong with this patch ? I still can't see it in
Linus' tree.
> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> drivers/spi/spi-s3c64xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
> index 5000586..71cc3e6 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)
> }
>
> 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;
> }
>
Thanks,
Sylwester
prev parent reply other threads:[~2013-06-10 16:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-27 14:56 [PATCH] spi: s3c64xx: Fix pm_runtime_get_sync() return value check Sylwester Nawrocki
2013-06-10 16:10 ` Sylwester Nawrocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B5FA86.5090705@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=grant.likely@linaro.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox