aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/soc_common.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2009-03-26 17:14:19 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:08 -0500
commit0f767de6a26a07f7d58394512b6f6c96322f047f (patch)
tree564a8c8c1b2ba960b03bf3235e16239f0ece9937 /drivers/pcmcia/soc_common.c
parenta7149f9a26eb44a5658d56335c23104ba529e9f6 (diff)
PCMCIA: soc_common: convert to a stand alone module
Convert soc_common.c to be a stand alone module, rather than wrapping it up into the individual SoC specific base modules. In doing this, we need to add init/exit functions for soc_common to register/remove the cpufreq notifier. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia/soc_common.c')
-rw-r--r--drivers/pcmcia/soc_common.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index ef7e9e58782b..a2d448f20b0f 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -609,15 +609,14 @@ static int soc_pcmcia_cpufreq_register(void)
609 "notifier for PCMCIA (%d)\n", ret); 609 "notifier for PCMCIA (%d)\n", ret);
610 return ret; 610 return ret;
611} 611}
612fs_initcall(soc_pcmcia_cpufreq_register);
612 613
613static void soc_pcmcia_cpufreq_unregister(void) 614static void soc_pcmcia_cpufreq_unregister(void)
614{ 615{
615 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER); 616 cpufreq_unregister_notifier(&soc_pcmcia_notifier_block, CPUFREQ_TRANSITION_NOTIFIER);
616} 617}
618module_exit(soc_pcmcia_cpufreq_unregister);
617 619
618#else
619static int soc_pcmcia_cpufreq_register(void) { return 0; }
620static void soc_pcmcia_cpufreq_unregister(void) {}
621#endif 620#endif
622 621
623int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, 622int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops,
@@ -668,9 +667,6 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
668 goto out_err_5; 667 goto out_err_5;
669 } 668 }
670 669
671 if (list_empty(&soc_pcmcia_sockets))
672 soc_pcmcia_cpufreq_register();
673
674 list_add(&skt->node, &soc_pcmcia_sockets); 670 list_add(&skt->node, &soc_pcmcia_sockets);
675 671
676 /* 672 /*
@@ -743,6 +739,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
743 mutex_unlock(&soc_pcmcia_sockets_lock); 739 mutex_unlock(&soc_pcmcia_sockets_lock);
744 return ret; 740 return ret;
745} 741}
742EXPORT_SYMBOL(soc_common_drv_pcmcia_probe);
746 743
747int soc_common_drv_pcmcia_remove(struct device *dev) 744int soc_common_drv_pcmcia_remove(struct device *dev)
748{ 745{
@@ -773,9 +770,6 @@ int soc_common_drv_pcmcia_remove(struct device *dev)
773 release_resource(&skt->res_io); 770 release_resource(&skt->res_io);
774 release_resource(&skt->res_skt); 771 release_resource(&skt->res_skt);
775 } 772 }
776 if (list_empty(&soc_pcmcia_sockets))
777 soc_pcmcia_cpufreq_unregister();
778
779 mutex_unlock(&soc_pcmcia_sockets_lock); 773 mutex_unlock(&soc_pcmcia_sockets_lock);
780 774
781 kfree(sinfo); 775 kfree(sinfo);
@@ -783,3 +777,7 @@ int soc_common_drv_pcmcia_remove(struct device *dev)
783 return 0; 777 return 0;
784} 778}
785EXPORT_SYMBOL(soc_common_drv_pcmcia_remove); 779EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
780
781MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
782MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support");
783MODULE_LICENSE("Dual MPL/GPL");