]> err.no Git - linux-2.6/blobdiff - drivers/mmc/core/sdio_irq.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-fixes-2.6
[linux-2.6] / drivers / mmc / core / sdio_irq.c
index e7865059e126b82ec6d330d2a899ce709d7672e0..c292e124107ac13ec36be751024ad3728cafaa40 100644 (file)
@@ -45,16 +45,22 @@ static int process_sdio_pending_irqs(struct mmc_card *card)
                                printk(KERN_WARNING "%s: pending IRQ for "
                                        "non-existant function\n",
                                        mmc_card_id(card));
+                               ret = -EINVAL;
                        } else if (func->irq_handler) {
                                func->irq_handler(func);
                                count++;
-                       } else
+                       } else {
                                printk(KERN_WARNING "%s: pending IRQ with no handler\n",
                                       sdio_func_id(func));
+                               ret = -EINVAL;
+                       }
                }
        }
 
-       return count;
+       if (count)
+               return count;
+
+       return ret;
 }
 
 static int sdio_irq_thread(void *_host)
@@ -122,12 +128,12 @@ static int sdio_irq_thread(void *_host)
                        }
                }
 
-               set_task_state(current, TASK_INTERRUPTIBLE);
+               set_current_state(TASK_INTERRUPTIBLE);
                if (host->caps & MMC_CAP_SDIO_IRQ)
                        host->ops->enable_sdio_irq(host, 1);
                if (!kthread_should_stop())
                        schedule_timeout(period);
-               set_task_state(current, TASK_RUNNING);
+               set_current_state(TASK_RUNNING);
        } while (!kthread_should_stop());
 
        if (host->caps & MMC_CAP_SDIO_IRQ)