diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-12-19 09:07:31 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-01-26 14:57:17 -0500 |
commit | e0d21178ceb06f5bfa81a5697f68384f74af054a (patch) | |
tree | 3ff7a16187d91c0e703f14ab9ea9d336719549d9 /drivers/pcmcia | |
parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) |
PCMCIA: soc_common: move common initialization into soc_common
Move common socket initialization into soc_common.c.
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/pxa2xx_base.c | 5 | ||||
-rw-r--r-- | drivers/pcmcia/sa1111_generic.c | 4 | ||||
-rw-r--r-- | drivers/pcmcia/sa11xx_base.c | 5 | ||||
-rw-r--r-- | drivers/pcmcia/soc_common.c | 10 | ||||
-rw-r--r-- | drivers/pcmcia/soc_common.h | 3 |
5 files changed, 15 insertions, 12 deletions
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index a87e2728b2c3..18474f046e7b 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -318,10 +318,7 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
318 | 318 | ||
319 | skt->nr = ops->first + i; | 319 | skt->nr = ops->first + i; |
320 | skt->clk = clk; | 320 | skt->clk = clk; |
321 | skt->ops = ops; | 321 | soc_pcmcia_init_one(skt, ops, &dev->dev); |
322 | skt->socket.owner = ops->owner; | ||
323 | skt->socket.dev.parent = &dev->dev; | ||
324 | skt->socket.pci_irq = NO_IRQ; | ||
325 | 322 | ||
326 | ret = pxa2xx_drv_pcmcia_add_one(skt); | 323 | ret = pxa2xx_drv_pcmcia_add_one(skt); |
327 | if (ret) | 324 | if (ret) |
diff --git a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c index 59866905ea37..7d6d3d423ef0 100644 --- a/drivers/pcmcia/sa1111_generic.c +++ b/drivers/pcmcia/sa1111_generic.c | |||
@@ -141,9 +141,7 @@ int sa1111_pcmcia_add(struct sa1111_dev *dev, struct pcmcia_low_level *ops, | |||
141 | return -ENOMEM; | 141 | return -ENOMEM; |
142 | 142 | ||
143 | s->soc.nr = ops->first + i; | 143 | s->soc.nr = ops->first + i; |
144 | s->soc.ops = ops; | 144 | soc_pcmcia_init_one(&s->soc, ops, &dev->dev); |
145 | s->soc.socket.owner = ops->owner; | ||
146 | s->soc.socket.dev.parent = &dev->dev; | ||
147 | s->soc.socket.pci_irq = s->soc.nr ? | 145 | s->soc.socket.pci_irq = s->soc.nr ? |
148 | dev->irq[IDX_IRQ_S0_READY_NINT] : | 146 | dev->irq[IDX_IRQ_S0_READY_NINT] : |
149 | dev->irq[IDX_IRQ_S1_READY_NINT]; | 147 | dev->irq[IDX_IRQ_S1_READY_NINT]; |
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 0c62fe31a40e..a3ee89a6dd0e 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c | |||
@@ -236,10 +236,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, | |||
236 | skt = &sinfo->skt[i]; | 236 | skt = &sinfo->skt[i]; |
237 | 237 | ||
238 | skt->nr = first + i; | 238 | skt->nr = first + i; |
239 | skt->ops = ops; | 239 | soc_pcmcia_init_one(skt, ops, dev); |
240 | skt->socket.owner = ops->owner; | ||
241 | skt->socket.dev.parent = dev; | ||
242 | skt->socket.pci_irq = NO_IRQ; | ||
243 | 240 | ||
244 | ret = sa11xx_drv_pcmcia_add_one(skt); | 241 | ret = sa11xx_drv_pcmcia_add_one(skt); |
245 | if (ret) | 242 | if (ret) |
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index a0a9c2aa8d78..84d90d5220ce 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -635,6 +635,16 @@ module_exit(soc_pcmcia_cpufreq_unregister); | |||
635 | 635 | ||
636 | #endif | 636 | #endif |
637 | 637 | ||
638 | void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt, | ||
639 | struct pcmcia_low_level *ops, struct device *dev) | ||
640 | { | ||
641 | skt->ops = ops; | ||
642 | skt->socket.owner = ops->owner; | ||
643 | skt->socket.dev.parent = dev; | ||
644 | skt->socket.pci_irq = NO_IRQ; | ||
645 | } | ||
646 | EXPORT_SYMBOL(soc_pcmcia_init_one); | ||
647 | |||
638 | void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt) | 648 | void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt) |
639 | { | 649 | { |
640 | mutex_lock(&soc_pcmcia_sockets_lock); | 650 | mutex_lock(&soc_pcmcia_sockets_lock); |
diff --git a/drivers/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h index 9daa73615c8b..3ff7ead11b1d 100644 --- a/drivers/pcmcia/soc_common.h +++ b/drivers/pcmcia/soc_common.h | |||
@@ -133,7 +133,8 @@ extern void soc_pcmcia_disable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia | |||
133 | extern void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr); | 133 | extern void soc_pcmcia_enable_irqs(struct soc_pcmcia_socket *skt, struct pcmcia_irqs *irqs, int nr); |
134 | extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *); | 134 | extern void soc_common_pcmcia_get_timing(struct soc_pcmcia_socket *, struct soc_pcmcia_timing *); |
135 | 135 | ||
136 | 136 | void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt, | |
137 | struct pcmcia_low_level *ops, struct device *dev); | ||
137 | void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt); | 138 | void soc_pcmcia_remove_one(struct soc_pcmcia_socket *skt); |
138 | int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt); | 139 | int soc_pcmcia_add_one(struct soc_pcmcia_socket *skt); |
139 | 140 | ||