diff options
author | Linus Torvalds | 2006-01-12 12:23:49 -0800 |
---|---|---|
committer | Linus Torvalds | 2006-01-12 12:23:49 -0800 |
commit | bf785ee0aeea7a3e717cb1e11df4135b6cbde7da (patch) | |
tree | 32ae52ad51c2a3952f2e1a2af9217717954fa593 /drivers/pcmcia | |
parent | 8b87e1baff24e586c3fe6c168843d213119bf4dd (diff) | |
parent | 00431707be0cc1236ee08459367872b57da5be29 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/pxa2xx_mainstone.c | 15 | ||||
-rw-r--r-- | drivers/pcmcia/pxa2xx_sharpsl.c | 19 |
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) { int ret; - mst_pcmcia_device = kzalloc(sizeof(*mst_pcmcia_device), GFP_KERNEL); + mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); if (!mst_pcmcia_device) return -ENOMEM; - mst_pcmcia_device->name = "pxa2xx-pcmcia"; + mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops; - ret = platform_device_register(mst_pcmcia_device); + ret = platform_device_add(mst_pcmcia_device); + if (ret) - kfree(mst_pcmcia_device); + platform_device_put(mst_pcmcia_device); return ret; } static void __exit mst_pcmcia_exit(void) { - /* - * This call is supposed to free our mst_pcmcia_device. - * Unfortunately platform_device don't have a free method, and - * we can't assume it's free of any reference at this point so we - * can't free it either. - */ platform_device_unregister(mst_pcmcia_device); } 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) { int ret; - sharpsl_pcmcia_ops.nr=platform_scoop_config->num_devs; - sharpsl_pcmcia_device = kzalloc(sizeof(*sharpsl_pcmcia_device), GFP_KERNEL); + sharpsl_pcmcia_ops.nr = platform_scoop_config->num_devs; + sharpsl_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); + if (!sharpsl_pcmcia_device) return -ENOMEM; - sharpsl_pcmcia_device->name = "pxa2xx-pcmcia"; sharpsl_pcmcia_device->dev.platform_data = &sharpsl_pcmcia_ops; - sharpsl_pcmcia_device->dev.parent=platform_scoop_config->devs[0].dev; + sharpsl_pcmcia_device->dev.parent = platform_scoop_config->devs[0].dev; + + ret = platform_device_add(sharpsl_pcmcia_device); - ret = platform_device_register(sharpsl_pcmcia_device); if (ret) - kfree(sharpsl_pcmcia_device); + platform_device_put(sharpsl_pcmcia_device); return ret; } static void __exit sharpsl_pcmcia_exit(void) { - /* - * This call is supposed to free our sharpsl_pcmcia_device. - * Unfortunately platform_device don't have a free method, and - * we can't assume it's free of any reference at this point so we - * can't free it either. - */ platform_device_unregister(sharpsl_pcmcia_device); } |