Skip to content

Commit 9af2037

Browse files
RandomReaperLinus Torvalds
authored andcommitted
at91: fix enable/disable_irq_wake symmetry in pcmcia driver
Fix enable_irq_wake and disable_irq_wake symmetry in at91 pcmcia driver 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. Signed-off-by: Marc Pignat <marc.pignat@hevs.ch> Cc: David Brownell <david-b@pacbell.net> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Pavel Machek <pavel@ucw.cz> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8387c1a commit 9af2037

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎drivers/pcmcia/at91_cf.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,16 +336,21 @@ static int at91_cf_suspend(struct platform_device *pdev, pm_message_t mesg)
336336
enable_irq_wake(board->det_pin);
337337
if (board->irq_pin)
338338
enable_irq_wake(board->irq_pin);
339-
} else {
340-
disable_irq_wake(board->det_pin);
341-
if (board->irq_pin)
342-
disable_irq_wake(board->irq_pin);
343339
}
344340
return 0;
345341
}
346342

347343
static int at91_cf_resume(struct platform_device *pdev)
348344
{
345+
struct at91_cf_socket *cf = platform_get_drvdata(pdev);
346+
struct at91_cf_data *board = cf->board;
347+
348+
if (device_may_wakeup(&pdev->dev)) {
349+
disable_irq_wake(board->det_pin);
350+
if (board->irq_pin)
351+
disable_irq_wake(board->irq_pin);
352+
}
353+
349354
pcmcia_socket_dev_resume(&pdev->dev);
350355
return 0;
351356
}

0 commit comments

Comments
 (0)