public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c-designware-pcidrv: fix the incorrect return of idle callback
@ 2014-01-28  5:48 xinhui.pan
       [not found] ` <52E744AC.2050606-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: xinhui.pan @ 2014-01-28  5:48 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, wsa-z923LK4zBo2bacvFa/9K2g,
	mika.westerberg-VuQAYsv1563Yd54FQh9/CA,
	andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA,
	yanmin_zhang-VuQAYsv1563Yd54FQh9/CA, bo.he-ral2JQCrhuEAvxtiuMwx3w

From: "xinhui.pan" <xinhuix.pan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

i2c_dw_pci_runtime_idle should return -EBUSY rather than zero if it do success.
Otherwise rpm_idle will call pm_suspend again and that may cause pm_schedule_suspend delay invalidate.
	
Signed-off-by: bo.he <bo.he-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: xinhui.pan <xinhuix.pan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 drivers/i2c/busses/i2c-designware-pcidrv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index f6ed06c..96e81f6 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -190,8 +190,8 @@ static int i2c_dw_pci_runtime_idle(struct device *dev)
 	int err = pm_schedule_suspend(dev, 500);
 	dev_dbg(dev, "runtime_idle called\n");
 
-	if (err != 0)
-		return 0;
+	if (err)
+		return err;
 	return -EBUSY;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-29 10:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28  5:48 [PATCH] i2c-designware-pcidrv: fix the incorrect return of idle callback xinhui.pan
     [not found] ` <52E744AC.2050606-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-01-28 18:30   ` Wolfram Sang
2014-01-29  2:03     ` xinhui.pan
     [not found]       ` <52E86175.6010300-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-01-29  7:35         ` xinhui.pan
2014-01-29  8:35     ` Mika Westerberg
     [not found]       ` <20140129083548.GG18029-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-01-29 10:00         ` xinhui.pan
     [not found]           ` <52E8D13A.1060100-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-01-29 10:38             ` Mika Westerberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox