From: Philippe Mathieu-Daudé Date: Thu, 3 Sep 2020 16:48:36 +0000 (+0200) Subject: hw/sd/sdhci: Let sdhci_update_irq() return if IRQ was delivered X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2bd9ae7e3087a5b853d67ddbedca1b94f88229cf;p=qmiga%2Fqemu.git hw/sd/sdhci: Let sdhci_update_irq() return if IRQ was delivered Signed-off-by: Philippe Mathieu-Daudé Tested-by: Alexander Bulekov Message-Id: <20200903172806.489710-4-f4bug@amsat.org> --- diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c index 4db77decf8..b93ecefd20 100644 --- a/hw/sd/sdhci.c +++ b/hw/sd/sdhci.c @@ -218,9 +218,14 @@ static uint8_t sdhci_slotint(SDHCIState *s) ((s->norintsts & SDHC_NIS_REMOVE) && (s->wakcon & SDHC_WKUP_ON_RMV)); } -static inline void sdhci_update_irq(SDHCIState *s) +/* Return true if IRQ was pending and delivered */ +static bool sdhci_update_irq(SDHCIState *s) { - qemu_set_irq(s->irq, sdhci_slotint(s)); + bool pending = sdhci_slotint(s); + + qemu_set_irq(s->irq, pending); + + return pending; } static void sdhci_raise_insertion_irq(void *opaque)