aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/sa1111_generic.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-26 08:25:47 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-09 10:34:50 -0500
commitae99ddbc976572194e8a68cb9ca1e27805ce30c7 (patch)
tree1c9beadf736c4038625a77cefd6f030cfba130ce /drivers/pcmcia/sa1111_generic.c
parent6bd72f0562142ddae26a052cfc4e578ad6953d06 (diff)
ARM: sa1111: add platform enable/disable functions
Add platform hooks to be called when individual sa1111 devices are enabled and disabled. This will allow us to move some platform specifics out of the individual drivers. Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia/sa1111_generic.c')
-rw-r--r--drivers/pcmcia/sa1111_generic.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
index 27f2fe3b7fb4..0735c3e6a8b0 100644
--- a/drivers/pcmcia/sa1111_generic.c
+++ b/drivers/pcmcia/sa1111_generic.c
@@ -163,12 +163,18 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops,
163static int pcmcia_probe(struct sa1111_dev *dev) 163static int pcmcia_probe(struct sa1111_dev *dev)
164{ 164{
165 void __iomem *base; 165 void __iomem *base;
166 int ret;
167
168 ret = sa1111_enable_device(dev);
169 if (ret)
170 return ret;
166 171
167 dev_set_drvdata(&dev->dev, NULL); 172 dev_set_drvdata(&dev->dev, NULL);
168 173
169 if (!request_mem_region(dev->res.start, 512, 174 if (!request_mem_region(dev->res.start, 512, SA1111_DRIVER_NAME(dev))) {
170 SA1111_DRIVER_NAME(dev))) 175 sa1111_disable_device(dev);
171 return -EBUSY; 176 return -EBUSY;
177 }
172 178
173 base = dev->mapbase; 179 base = dev->mapbase;
174 180
@@ -212,6 +218,7 @@ static int __devexit pcmcia_remove(struct sa1111_dev *dev)
212 } 218 }
213 219
214 release_mem_region(dev->res.start, 512); 220 release_mem_region(dev->res.start, 512);
221 sa1111_disable_device(dev);
215 return 0; 222 return 0;
216} 223}
217 224