public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] at91: fix enable/disable_irq_wake symmetry in pcmcia driver
@ 2007-05-10  8:09 Marc Pignat
  2007-05-10 22:26 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Pignat @ 2007-05-10  8:09 UTC (permalink / raw)
  To: andrew; +Cc: linux-kernel, dbrownell

from Marc Pignat <marc.pignat@hevs.ch>

fix enable_irq_wake and disable_irq_wake symmetry in at91 pcmcia driver

Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
---
Please forget the [PATCH] at91: fix enable/disable_irq_wake symmetry in pcmcia driver,
it doesn't compile... Here is the good patch!

This patch applies to the 2.6.21.1 kernel.

disable_irq_wake call must be symmetric with enable_irq_wake. This patch fix 
that problem for the at91_pcmia driver.
It seems that this patch was forgotten when we've fixed irq_wake symmetry in 
all at91 related drivers.
It was discussed in the "at91 drivers and [enable/disable]_irq_wake (wrong?) 
usage" thread on the linux-arm-kernel mailing list.

Regards

Marc

--- 2.6.21.1/drivers/pcmcia/at91_cf.c.orig	2007-05-10 08:43:16.000000000 +0200
+++ 2.6.21.1/drivers/pcmcia/at91_cf.c	2007-05-10 10:03:58.000000000 +0200
@@ -336,16 +336,21 @@ static int at91_cf_suspend(struct platfo
 		enable_irq_wake(board->det_pin);
 		if (board->irq_pin)
 			enable_irq_wake(board->irq_pin);
-	} else {
-		disable_irq_wake(board->det_pin);
-		if (board->irq_pin)
-			disable_irq_wake(board->irq_pin);
 	}
 	return 0;
 }

 static int at91_cf_resume(struct platform_device *pdev)
 {
+	struct at91_cf_socket	*cf = platform_get_drvdata(pdev);
+	struct at91_cf_data	*board = cf->board;
+
+	if (device_may_wakeup(&pdev->dev)) {
+		disable_irq_wake(board->det_pin);
+		if (board->irq_pin)
+			disable_irq_wake(board->irq_pin);
+	}
+
 	pcmcia_socket_dev_resume(&pdev->dev);
 	return 0;
 }

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

end of thread, other threads:[~2007-05-11  6:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-10  8:09 [PATCHv2] at91: fix enable/disable_irq_wake symmetry in pcmcia driver Marc Pignat
2007-05-10 22:26 ` Andrew Morton
2007-05-11  6:01   ` David Brownell

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