aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/maps
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:21:18 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 17:59:02 -0500
commit98e4c28b7ec390c2dad6a4c69d69629c0f7e8b10 (patch)
treeb3d46f0643352e541d6a39e6da09059687cf713d /drivers/mtd/maps
parent63e7ebd06402951bc8863ba5b7bc9b9f42044849 (diff)
[PATCH] pcmcia: new suspend core
Move the suspend and resume methods out of the event handler, and into special functions. Also use these functions for pre- and post-reset, as almost all drivers already do, and the remaining ones can easily be converted. Bugfix to include/pcmcia/ds.c Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/mtd/maps')
-rw-r--r--drivers/mtd/maps/pcmciamtd.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index af24216a0626..86443cf44dc6 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -691,6 +691,24 @@ static void pcmciamtd_config(dev_link_t *link)
691} 691}
692 692
693 693
694static int pcmciamtd_suspend(struct pcmcia_device *dev)
695{
696 DEBUG(2, "EVENT_PM_RESUME");
697
698 /* get_lock(link); */
699
700 return 0;
701}
702
703static int pcmciamtd_resume(struct pcmcia_device *dev)
704{
705 DEBUG(2, "EVENT_PM_SUSPEND");
706
707 /* free_lock(link); */
708
709 return 0;
710}
711
694/* The card status event handler. Mostly, this schedules other 712/* The card status event handler. Mostly, this schedules other
695 * stuff to run after an event is received. A CARD_REMOVAL event 713 * stuff to run after an event is received. A CARD_REMOVAL event
696 * also sets some flags to discourage the driver from trying 714 * also sets some flags to discourage the driver from trying
@@ -721,22 +739,6 @@ static int pcmciamtd_event(event_t event, int priority,
721 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 739 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
722 pcmciamtd_config(link); 740 pcmciamtd_config(link);
723 break; 741 break;
724 case CS_EVENT_PM_SUSPEND:
725 DEBUG(2, "EVENT_PM_SUSPEND");
726 link->state |= DEV_SUSPEND;
727 /* Fall through... */
728 case CS_EVENT_RESET_PHYSICAL:
729 DEBUG(2, "EVENT_RESET_PHYSICAL");
730 /* get_lock(link); */
731 break;
732 case CS_EVENT_PM_RESUME:
733 DEBUG(2, "EVENT_PM_RESUME");
734 link->state &= ~DEV_SUSPEND;
735 /* Fall through... */
736 case CS_EVENT_CARD_RESET:
737 DEBUG(2, "EVENT_CARD_RESET");
738 /* free_lock(link); */
739 break;
740 default: 742 default:
741 DEBUG(2, "Unknown event %d", event); 743 DEBUG(2, "Unknown event %d", event);
742 } 744 }
@@ -848,6 +850,8 @@ static struct pcmcia_driver pcmciamtd_driver = {
848 .detach = pcmciamtd_detach, 850 .detach = pcmciamtd_detach,
849 .owner = THIS_MODULE, 851 .owner = THIS_MODULE,
850 .id_table = pcmciamtd_ids, 852 .id_table = pcmciamtd_ids,
853 .suspend = pcmciamtd_suspend,
854 .resume = pcmciamtd_resume,
851}; 855};
852 856
853 857