aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2009-03-26 18:21:18 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-09 02:30:10 -0500
commitbe85458edce0f165cff62622f5e73b1d17b1e228 (patch)
tree01e3c995abab8f3533d2075d99f5a4a2d95e1948 /drivers/pcmcia
parent097e296d6175881eba7244de7222de61e9569911 (diff)
PCMCIA: soc_common: push socket removal down to SoC specific support
Mechanically transplant the removal code from soc_common into each SoC specific base support file, thereby allowing soc_common_drv_pcmcia_remove to be removed. No other changes. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/pxa2xx_base.c11
-rw-r--r--drivers/pcmcia/sa1100_generic.c11
-rw-r--r--drivers/pcmcia/sa1111_generic.c10
-rw-r--r--drivers/pcmcia/soc_common.c16
-rw-r--r--drivers/pcmcia/soc_common.h1
5 files changed, 29 insertions, 20 deletions
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index 0e35acb1366b..8a91106056fc 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -297,7 +297,16 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
297 297
298static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) 298static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev)
299{ 299{
300 return soc_common_drv_pcmcia_remove(&dev->dev); 300 struct skt_dev_info *sinfo = platform_get_drvdata(dev);
301 int i;
302
303 platform_set_drvdata(dev, NULL);
304
305 for (i = 0; i < sinfo->nskt; i++)
306 soc_pcmcia_remove_one(&sinfo->skt[i]);
307
308 kfree(sinfo);
309 return 0;
301} 310}
302 311
303static int pxa2xx_drv_pcmcia_suspend(struct device *dev) 312static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
diff --git a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
index 2d0e99751530..11cc3ba1260a 100644
--- a/drivers/pcmcia/sa1100_generic.c
+++ b/drivers/pcmcia/sa1100_generic.c
@@ -83,7 +83,16 @@ static int sa11x0_drv_pcmcia_probe(struct platform_device *dev)
83 83
84static int sa11x0_drv_pcmcia_remove(struct platform_device *dev) 84static int sa11x0_drv_pcmcia_remove(struct platform_device *dev)
85{ 85{
86 return soc_common_drv_pcmcia_remove(&dev->dev); 86 struct skt_dev_info *sinfo = platform_get_drvdata(dev);
87 int i;
88
89 platform_set_drvdata(dev, NULL);
90
91 for (i = 0; i < sinfo->nskt; i++)
92 soc_pcmcia_remove_one(&sinfo->skt[i]);
93
94 kfree(sinfo);
95 return 0;
87} 96}
88 97
89static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev, 98static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 4be4e172ffa1..a6793e30cf71 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -152,7 +152,15 @@ static int pcmcia_probe(struct sa1111_dev *dev)
152 152
153static int __devexit pcmcia_remove(struct sa1111_dev *dev) 153static int __devexit pcmcia_remove(struct sa1111_dev *dev)
154{ 154{
155 soc_common_drv_pcmcia_remove(&dev->dev); 155 struct skt_dev_info *sinfo = dev_get_drvdata(&dev->dev);
156 int i;
157
158 dev_set_drvdata(&dev->dev, NULL);
159
160 for (i = 0; i < sinfo->nskt; i++)
161 soc_pcmcia_remove_one(&sinfo->skt[i]);
162
163 kfree(sinfo);
156 release_mem_region(dev->res.start, 512); 164 release_mem_region(dev->res.start, 512);
157 return 0; 165 return 0;
158} 166}
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c
index 9bfa74a6d8ff..fb5377d17af4 100644
--- a/drivers/pcmcia/soc_common.c
+++ b/drivers/pcmcia/soc_common.c
@@ -778,22 +778,6 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
778} 778}
779EXPORT_SYMBOL(soc_common_drv_pcmcia_probe); 779EXPORT_SYMBOL(soc_common_drv_pcmcia_probe);
780 780
781int soc_common_drv_pcmcia_remove(struct device *dev)
782{
783 struct skt_dev_info *sinfo = dev_get_drvdata(dev);
784 int i;
785
786 dev_set_drvdata(dev, NULL);
787
788 for (i = 0; i < sinfo->nskt; i++)
789 soc_pcmcia_remove_one(&sinfo->skt[i]);
790
791 kfree(sinfo);
792
793 return 0;
794}
795EXPORT_SYMBOL(soc_common_drv_pcmcia_remove);
796
797MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>"); 781MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>");
798MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support"); 782MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support");
799MODULE_LICENSE("Dual MPL/GPL"); 783MODULE_LICENSE("Dual MPL/GPL");
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h
index 51c72bae018e..c33b8c314fb0 100644
--- a/drivers/pcmcia/soc_common.h
+++ b/drivers/pcmcia/soc_common.h
@@ -139,7 +139,6 @@ void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt);
139int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt); 139int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt);
140 140
141extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo); 141extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo);
142extern int soc_common_drv_pcmcia_remove(struct device *dev);
143 142
144 143
145#ifdef CONFIG_PCMCIA_DEBUG 144#ifdef CONFIG_PCMCIA_DEBUG