From patchwork Mon Jun 10 16:22:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2698351 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork2.kernel.org (Postfix) with ESMTP id 7A5DEDF264 for ; Mon, 10 Jun 2013 16:23:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Um4sE-0006kT-Gn; Mon, 10 Jun 2013 16:23:14 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1Um4sD-0006kJ-44 for spi-devel-general@lists.sourceforge.net; Mon, 10 Jun 2013 16:23:13 +0000 X-ACL-Warn: Received: from mailout4.samsung.com ([203.254.224.34]) by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1Um4s8-0007Qd-DW for spi-devel-general@lists.sourceforge.net; Mon, 10 Jun 2013 16:23:13 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MO600GEVQUD5SR0@mailout4.samsung.com> for spi-devel-general@lists.sourceforge.net; Tue, 11 Jun 2013 01:23:01 +0900 (KST) X-AuditID: cbfee61a-b7f3b6d000006edd-ce-51b5fd65659d Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id B2.17.28381.56DF5B15; Tue, 11 Jun 2013 01:23:01 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MO600MB4QTN8Z30@mmp1.samsung.com>; Tue, 11 Jun 2013 01:23:01 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Subject: [PATCH RESEND] spi: s3c64xx: Fix pm_runtime_get_sync() return value check Date: Mon, 10 Jun 2013 18:22:26 +0200 Message-id: <1370881346-28000-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrIJMWRmVeSWpSXmKPExsVy+t9jAd3Uv1sDDd5fN7OY+vAJm8XZpjfs Fpd3zWGzmHF+H5PF4TftrBZHpjSyO7B5bFrVyeaxe8FnJo++LasYPT5vkgtgieKySUnNySxL LdK3S+DKeHD2LXPBN86Kj79PMzYwTuboYuTkkBAwkeg5dpYRwhaTuHBvPVsXIxeHkMAiRok5 Db1QTgeTxNN1j1lAqtgEDCV6j/aBdYgAddye08kMYjML7GCUOLjEHcQWFgiR2DX/HSuIzSKg KvH5+Eewel4BN4mls6YBDeUA2qYgMWeSzQRG7gWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLz czcxggPimdQOxpUNFocYBTgYlXh4H/zaEijEmlhWXJl7iFGCg1lJhDf5zdZAId6UxMqq1KL8 +KLSnNTiQ4zSHCxK4rwHWq0DhQTSE0tSs1NTC1KLYLJMHJxSDYwZnzkYbkx1yJUSvzSXubPB q+hM+fIF8acZTctdog32ndVyatsS6n6w1mnvmYooR45XeRxzrDnXnxe91MO66Kh9xhGFi1l5 f+a1/5jz99njiae/1ETFOPf8qwxUM3D6aihTOvn0urRAz2czhUz8gyanO3Ufb4184Hzp4qcM nV47lmnLDCVjlyuxFGckGmoxFxUnAgBDvPp6BAIAAA== X-Spam-Score: -0.1 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1Um4s8-0007Qd-DW Cc: spi-devel-general@lists.sourceforge.net, kyungmin.park@samsung.com, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Sylwester Nawrocki X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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 Signed-off-by: Kyungmin Park --- I used broonie@kernel.org e-mail address this time, as found in MAINATAINERS, instead of broonie@opensource.wolfsonmicro.com which seems to be inactive. drivers/spi/spi-s3c64xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev 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; }