path: root/drivers/mfd/glamo/glamo-mci.c
diff options
authorWerner Almesberger <werner@openmoko.org>2009-01-15 13:49:14 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2009-01-15 13:49:14 +0000
commite2c4ed27f22b26aec093585b294c7cb4241375a8 (patch)
treef193265935d57f3a8e065176fdbd430d8180dc01 /drivers/mfd/glamo/glamo-mci.c
parente2c0650efa751a6a2220618695fa41a2a5e7d23c (diff)
avoid using irq_desc in glamo-mci.c
When building the MMC subsystem as modules, drivers/mfd/glamo/glamo-mci.ko cannot access irq_desc, because it isn't exported by kernel/irq/handle.c All the functions that indirectly access irq_desc are inlined, so they cannot be used to avoid having to resolve irq_desc. Fortunately, we can solve the problem locally: we don't really need to access irq_desc anyway. This patch splits glamo_mci_irq into a small wrapper that implements the IRQ handler interface and the main code that doesn't need to know about the semantics of the latter. Then we simply call the main code with the information we already have. Signed-off-by: Werner Almesberger <werner@openmoko.org> Tested-by: Rafael Ignacio Zurita <rizurita@yahoo.com>
Diffstat (limited to 'drivers/mfd/glamo/glamo-mci.c')
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/mfd/glamo/glamo-mci.c b/drivers/mfd/glamo/glamo-mci.c
index 778e47c7427..e836913ea23 100644
--- a/drivers/mfd/glamo/glamo-mci.c
+++ b/drivers/mfd/glamo/glamo-mci.c
@@ -331,17 +331,12 @@ static int __glamo_mci_set_card_clock(struct glamo_mci_host *host, int freq,
return real_rate;
-static void glamo_mci_irq(unsigned int irq, struct irq_desc *desc)
+static void glamo_mci_irq_host(struct glamo_mci_host *host)
- struct glamo_mci_host *host = (struct glamo_mci_host *)
- desc->handler_data;
u16 status;
struct mmc_command *cmd;
unsigned long iflags;
- if (!host)
- return;
if (host->suspending) { /* bad news, dangerous time */
dev_err(&host->pdev->dev, "****glamo_mci_irq before resumed\n");
@@ -405,6 +400,16 @@ done:
spin_unlock_irqrestore(&host->complete_lock, iflags);
+static void glamo_mci_irq(unsigned int irq, struct irq_desc *desc)
+ struct glamo_mci_host *host = (struct glamo_mci_host *)
+ desc->handler_data;
+ if (host)
+ glamo_mci_irq_host(host);
static int glamo_mci_send_command(struct glamo_mci_host *host,
struct mmc_command *cmd)
@@ -718,8 +723,7 @@ static void glamo_mci_send_request(struct mmc_host *mmc)
/* yay we are an interrupt controller! -- call the ISR
* it will stop clock to card
- glamo_mci_irq(IRQ_GLAMO(GLAMO_IRQIDX_MMC),
+ glamo_mci_irq_host(host);