X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fpcmcia%2Fpxa2xx_mainstone.c;h=877001db4916c809d4e51356bd9dc84613ac6c7d;hb=a09e64fbc0094e3073dbb09c3b4bfe4ab669244b;hp=6fa5eaaab8afcf4188fd27f04bb95aa9c5746d16;hpb=37e58df30063e229ee5157f9d1c1fa1d749917c2;p=linux-2.6 diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c index 6fa5eaaab8..877001db49 100644 --- a/drivers/pcmcia/pxa2xx_mainstone.c +++ b/drivers/pcmcia/pxa2xx_mainstone.c @@ -21,11 +21,12 @@ #include -#include +#include +#include #include -#include -#include +#include +#include #include "soc_common.h" @@ -99,7 +100,7 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, case 50: power |= MST_PCMCIA_PWR_VCC_50; break; default: printk(KERN_ERR "%s(): bad Vcc %u\n", - __FUNCTION__, state->Vcc); + __func__, state->Vcc); ret = -1; } @@ -111,7 +112,7 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, power |= MST_PCMCIA_PWR_VPP_VCC; } else { printk(KERN_ERR "%s(): bad Vpp %u\n", - __FUNCTION__, state->Vpp); + __func__, state->Vpp); ret = -1; } } @@ -136,7 +137,7 @@ static void mst_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) { } -static struct pcmcia_low_level mst_pcmcia_ops = { +static struct pcmcia_low_level mst_pcmcia_ops __initdata = { .owner = THIS_MODULE, .hw_init = mst_pcmcia_hw_init, .hw_shutdown = mst_pcmcia_hw_shutdown, @@ -153,13 +154,17 @@ static int __init mst_pcmcia_init(void) { int ret; + if (!machine_is_mainstone()) + return -ENODEV; + mst_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); if (!mst_pcmcia_device) return -ENOMEM; - mst_pcmcia_device->dev.platform_data = &mst_pcmcia_ops; - - ret = platform_device_add(mst_pcmcia_device); + ret = platform_device_add_data(mst_pcmcia_device, &mst_pcmcia_ops, + sizeof(mst_pcmcia_ops)); + if (ret == 0) + ret = platform_device_add(mst_pcmcia_device); if (ret) platform_device_put(mst_pcmcia_device);