X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpcmcia%2Fpxa2xx_mainstone.c;h=383107ba4bd3f8859c8fde3c8c722e734c9fd229;hb=0d027c01cd36b8cff727c78d2e40d334ba9895a8;hp=5209d8c7764fc13215135a9d6bfb3f0828ca380e;hpb=7079060f3e86ea4c1d4e9c1e356592ef9dcaaa1f;p=linux-2.6-omap-h63xx.git diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c index 5209d8c7764..383107ba4bd 100644 --- a/drivers/pcmcia/pxa2xx_mainstone.c +++ b/drivers/pcmcia/pxa2xx_mainstone.c @@ -171,28 +171,23 @@ static int __init mst_pcmcia_init(void) { int ret; - mst_pcmcia_device = kmalloc(sizeof(*mst_pcmcia_device), GFP_KERNEL); + mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); if (!mst_pcmcia_device) return -ENOMEM; - memset(mst_pcmcia_device, 0, sizeof(*mst_pcmcia_device)); - mst_pcmcia_device->name = "pxa2xx-pcmcia"; + + mst_pcmcia_device->dev.uevent_suppress = 0; 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); }