diff options
Diffstat (limited to 'drivers/pcmcia/pxa2xx_cm_x270.c')
-rw-r--r-- | drivers/pcmcia/pxa2xx_cm_x270.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c index e7ab060ff118..f123fce65f2e 100644 --- a/drivers/pcmcia/pxa2xx_cm_x270.c +++ b/drivers/pcmcia/pxa2xx_cm_x270.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <pcmcia/ss.h> | 19 | #include <pcmcia/ss.h> |
20 | #include <asm/hardware.h> | 20 | #include <asm/hardware.h> |
21 | #include <asm/mach-types.h> | ||
21 | 22 | ||
22 | #include <asm/arch/pxa-regs.h> | 23 | #include <asm/arch/pxa-regs.h> |
23 | #include <asm/arch/pxa2xx-gpio.h> | 24 | #include <asm/arch/pxa2xx-gpio.h> |
@@ -130,7 +131,7 @@ static void cmx270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | |||
130 | } | 131 | } |
131 | 132 | ||
132 | 133 | ||
133 | static struct pcmcia_low_level cmx270_pcmcia_ops = { | 134 | static struct pcmcia_low_level cmx270_pcmcia_ops __initdata = { |
134 | .owner = THIS_MODULE, | 135 | .owner = THIS_MODULE, |
135 | .hw_init = cmx270_pcmcia_hw_init, | 136 | .hw_init = cmx270_pcmcia_hw_init, |
136 | .hw_shutdown = cmx270_pcmcia_shutdown, | 137 | .hw_shutdown = cmx270_pcmcia_shutdown, |
@@ -147,15 +148,21 @@ static int __init cmx270_pcmcia_init(void) | |||
147 | { | 148 | { |
148 | int ret; | 149 | int ret; |
149 | 150 | ||
151 | if (!machine_is_armcore()) | ||
152 | return -ENODEV; | ||
153 | |||
150 | cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | 154 | cmx270_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); |
151 | 155 | ||
152 | if (!cmx270_pcmcia_device) | 156 | if (!cmx270_pcmcia_device) |
153 | return -ENOMEM; | 157 | return -ENOMEM; |
154 | 158 | ||
155 | cmx270_pcmcia_device->dev.platform_data = &cmx270_pcmcia_ops; | 159 | ret = platform_device_add_data(cmx270_pcmcia_device, &cmx270_pcmcia_ops, |
160 | sizeof(cmx270_pcmcia_ops)); | ||
156 | 161 | ||
157 | printk(KERN_INFO "Registering cm-x270 PCMCIA interface.\n"); | 162 | if (ret == 0) { |
158 | ret = platform_device_add(cmx270_pcmcia_device); | 163 | printk(KERN_INFO "Registering cm-x270 PCMCIA interface.\n"); |
164 | ret = platform_device_add(cmx270_pcmcia_device); | ||
165 | } | ||
159 | 166 | ||
160 | if (ret) | 167 | if (ret) |
161 | platform_device_put(cmx270_pcmcia_device); | 168 | platform_device_put(cmx270_pcmcia_device); |