aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/vrc4171_card.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/vrc4171_card.c')
-rw-r--r--drivers/pcmcia/vrc4171_card.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index b2c412419059..659421d0ca46 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -704,24 +704,37 @@ static int __devinit vrc4171_card_setup(char *options)
704 704
705__setup("vrc4171_card=", vrc4171_card_setup); 705__setup("vrc4171_card=", vrc4171_card_setup);
706 706
707static struct device_driver vrc4171_card_driver = { 707static int vrc4171_card_suspend(struct platform_device *dev,
708 .name = vrc4171_card_name, 708 pm_message_t state)
709 .bus = &platform_bus_type, 709{
710 .suspend = pcmcia_socket_dev_suspend, 710 return pcmcia_socket_dev_suspend(&dev->dev, state);
711 .resume = pcmcia_socket_dev_resume, 711}
712
713static int vrc4171_card_resume(struct platform_device *dev)
714{
715 return pcmcia_socket_dev_resume(&dev->dev);
716}
717
718static struct platform_driver vrc4171_card_driver = {
719 .driver = {
720 .name = vrc4171_card_name,
721 .owner = THIS_MODULE,
722 },
723 .suspend = vrc4171_card_suspend,
724 .resume = vrc4171_card_resume,
712}; 725};
713 726
714static int __devinit vrc4171_card_init(void) 727static int __devinit vrc4171_card_init(void)
715{ 728{
716 int retval; 729 int retval;
717 730
718 retval = driver_register(&vrc4171_card_driver); 731 retval = platform_driver_register(&vrc4171_card_driver);
719 if (retval < 0) 732 if (retval < 0)
720 return retval; 733 return retval;
721 734
722 retval = platform_device_register(&vrc4171_card_device); 735 retval = platform_device_register(&vrc4171_card_device);
723 if (retval < 0) { 736 if (retval < 0) {
724 driver_unregister(&vrc4171_card_driver); 737 platform_driver_unregister(&vrc4171_card_driver);
725 return retval; 738 return retval;
726 } 739 }
727 740
@@ -735,11 +748,12 @@ static int __devinit vrc4171_card_init(void)
735 if (retval < 0) { 748 if (retval < 0) {
736 vrc4171_remove_sockets(); 749 vrc4171_remove_sockets();
737 platform_device_unregister(&vrc4171_card_device); 750 platform_device_unregister(&vrc4171_card_device);
738 driver_unregister(&vrc4171_card_driver); 751 platform_driver_unregister(&vrc4171_card_driver);
739 return retval; 752 return retval;
740 } 753 }
741 754
742 printk(KERN_INFO "%s, connected to IRQ %d\n", vrc4171_card_driver.name, vrc4171_irq); 755 printk(KERN_INFO "%s, connected to IRQ %d\n",
756 vrc4171_card_driver.driver.name, vrc4171_irq);
743 757
744 return 0; 758 return 0;
745} 759}
@@ -749,7 +763,7 @@ static void __devexit vrc4171_card_exit(void)
749 free_irq(vrc4171_irq, vrc4171_sockets); 763 free_irq(vrc4171_irq, vrc4171_sockets);
750 vrc4171_remove_sockets(); 764 vrc4171_remove_sockets();
751 platform_device_unregister(&vrc4171_card_device); 765 platform_device_unregister(&vrc4171_card_device);
752 driver_unregister(&vrc4171_card_driver); 766 platform_driver_unregister(&vrc4171_card_driver);
753} 767}
754 768
755module_init(vrc4171_card_init); 769module_init(vrc4171_card_init);