From e2c4ed27f22b26aec093585b294c7cb4241375a8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 15 Jan 2009 13:49:14 +0000 Subject: 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 Tested-by: Rafael Ignacio Zurita --- drivers/mfd/glamo/glamo-mci.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'drivers/mfd/glamo/glamo-mci.c') 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"); return; @@ -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), - irq_desc + IRQ_GLAMO(GLAMO_IRQIDX_MMC)); + glamo_mci_irq_host(host); } return; -- cgit v1.2.3