In case a bootloader leaves the device in a bad state,
requesting the interrupt before resetting results in a bad
interrupt loop.
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
[Ezequiel: cleanup commit description]
Tested-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.co.uk>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
        spin_lock_init(&host->lock);
        host->irq_mask = 0xffff;
 
+       jz4740_mmc_reset(host);
+
        ret = request_threaded_irq(host->irq, jz_mmc_irq, jz_mmc_irq_worker, 0,
                        dev_name(&pdev->dev), host);
        if (ret) {
                goto err_free_gpios;
        }
 
-       jz4740_mmc_reset(host);
        jz4740_mmc_clock_disable(host);
        timer_setup(&host->timeout_timer, jz4740_mmc_timeout, 0);