Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Russell King - ARM Linux and committed by
Dominik Brodowski
be85458e 097e296d

+29 -20
+10 -1
drivers/pcmcia/pxa2xx_base.c
··· 297 297 298 298 static 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 303 312 static int pxa2xx_drv_pcmcia_suspend(struct device *dev)
+10 -1
drivers/pcmcia/sa1100_generic.c
··· 83 83 84 84 static 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 89 98 static int sa11x0_drv_pcmcia_suspend(struct platform_device *dev,
+9 -1
drivers/pcmcia/sa1111_generic.c
··· 152 152 153 153 static 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 164 release_mem_region(dev->res.start, 512); 157 165 return 0; 158 166 }
-16
drivers/pcmcia/soc_common.c
··· 778 778 } 779 779 EXPORT_SYMBOL(soc_common_drv_pcmcia_probe); 780 780 781 - int 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 - } 795 - EXPORT_SYMBOL(soc_common_drv_pcmcia_remove); 796 - 797 781 MODULE_AUTHOR("John Dorsey <john+@cs.cmu.edu>"); 798 782 MODULE_DESCRIPTION("Linux PCMCIA Card Services: Common SoC support"); 799 783 MODULE_LICENSE("Dual MPL/GPL");
-1
drivers/pcmcia/soc_common.h
··· 139 139 int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt); 140 140 141 141 extern int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, struct skt_dev_info *sinfo); 142 - extern int soc_common_drv_pcmcia_remove(struct device *dev); 143 142 144 143 145 144 #ifdef CONFIG_PCMCIA_DEBUG