aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 15:23:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 15:23:49 -0500
commitbf785ee0aeea7a3e717cb1e11df4135b6cbde7da (patch)
tree32ae52ad51c2a3952f2e1a2af9217717954fa593 /drivers/pcmcia
parent8b87e1baff24e586c3fe6c168843d213119bf4dd (diff)
parent00431707be0cc1236ee08459367872b57da5be29 (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/pxa2xx_mainstone.c15
-rw-r--r--drivers/pcmcia/pxa2xx_sharpsl.c19
2 files changed, 12 insertions, 22 deletions
diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c
index 5d957dfe23d9..fda06941e730 100644
--- a/drivers/pcmcia/pxa2xx_mainstone.c
+++ b/drivers/pcmcia/pxa2xx_mainstone.c
@@ -171,27 +171,22 @@ static int __init mst_pcmcia_init(void)
171{ 171{
172 int ret; 172 int ret;
173 173
174 mst_pcmcia_device = kzalloc(sizeof(*mst_pcmcia_device), GFP_KERNEL); 174 mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
175 if (!mst_pcmcia_device) 175 if (!mst_pcmcia_device)
176 return -ENOMEM; 176 return -ENOMEM;
177 mst_pcmcia_device->name = "pxa2xx-pcmcia"; 177
178 mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops; 178 mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops;
179 179
180 ret = platform_device_register(mst_pcmcia_device); 180 ret = platform_device_add(mst_pcmcia_device);
181
181 if (ret) 182 if (ret)
182 kfree(mst_pcmcia_device); 183 platform_device_put(mst_pcmcia_device);
183 184
184 return ret; 185 return ret;
185} 186}
186 187
187static void __exit mst_pcmcia_exit(void) 188static void __exit mst_pcmcia_exit(void)
188{ 189{
189 /*
190 * This call is supposed to free our mst_pcmcia_device.
191 * Unfortunately platform_device don't have a free method, and
192 * we can't assume it's free of any reference at this point so we
193 * can't free it either.
194 */
195 platform_device_unregister(mst_pcmcia_device); 190 platform_device_unregister(mst_pcmcia_device);
196} 191}
197 192
diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c
index 12a7244a5ec8..fd3647368955 100644
--- a/drivers/pcmcia/pxa2xx_sharpsl.c
+++ b/drivers/pcmcia/pxa2xx_sharpsl.c
@@ -263,30 +263,25 @@ static int __init sharpsl_pcmcia_init(void)
263{ 263{
264 int ret; 264 int ret;
265 265
266 sharpsl_pcmcia_ops.nr=platform_scoop_config->num_devs; 266 sharpsl_pcmcia_ops.nr = platform_scoop_config->num_devs;
267 sharpsl_pcmcia_device = kzalloc(sizeof(*sharpsl_pcmcia_device), GFP_KERNEL); 267 sharpsl_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
268
268 if (!sharpsl_pcmcia_device) 269 if (!sharpsl_pcmcia_device)
269 return -ENOMEM; 270 return -ENOMEM;
270 271
271 sharpsl_pcmcia_device->name = "pxa2xx-pcmcia";
272 sharpsl_pcmcia_device->dev.platform_data = &sharpsl_pcmcia_ops; 272 sharpsl_pcmcia_device->dev.platform_data = &sharpsl_pcmcia_ops;
273 sharpsl_pcmcia_device->dev.parent=platform_scoop_config->devs[0].dev; 273 sharpsl_pcmcia_device->dev.parent = platform_scoop_config->devs[0].dev;
274
275 ret = platform_device_add(sharpsl_pcmcia_device);
274 276
275 ret = platform_device_register(sharpsl_pcmcia_device);
276 if (ret) 277 if (ret)
277 kfree(sharpsl_pcmcia_device); 278 platform_device_put(sharpsl_pcmcia_device);
278 279
279 return ret; 280 return ret;
280} 281}
281 282
282static void __exit sharpsl_pcmcia_exit(void) 283static void __exit sharpsl_pcmcia_exit(void)
283{ 284{
284 /*
285 * This call is supposed to free our sharpsl_pcmcia_device.
286 * Unfortunately platform_device don't have a free method, and
287 * we can't assume it's free of any reference at this point so we
288 * can't free it either.
289 */
290 platform_device_unregister(sharpsl_pcmcia_device); 285 platform_device_unregister(sharpsl_pcmcia_device);
291} 286}
292 287