Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macintosh/via-macii: Fix "BUG: sleeping function called from invalid context"

The via-macii ADB driver calls request_irq() after disabling hard
interrupts. But disabling interrupts isn't necessary here because the
VIA shift register interrupt was masked during VIA1 initialization.

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/419fcc09d0e563b425c419053d02236b044d86b0.1710298421.git.fthain@linux-m68k.org
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

authored by

Finn Thain and committed by
Geert Uytterhoeven
d301a71c d39d1677

+3 -8
+3 -8
drivers/macintosh/via-macii.c
··· 140 140 /* Initialize the driver */ 141 141 static int macii_init(void) 142 142 { 143 - unsigned long flags; 144 143 int err; 145 - 146 - local_irq_save(flags); 147 144 148 145 err = macii_init_via(); 149 146 if (err) 150 - goto out; 147 + return err; 151 148 152 149 err = request_irq(IRQ_MAC_ADB, macii_interrupt, 0, "ADB", 153 150 macii_interrupt); 154 151 if (err) 155 - goto out; 152 + return err; 156 153 157 154 macii_state = idle; 158 - out: 159 - local_irq_restore(flags); 160 - return err; 155 + return 0; 161 156 } 162 157 163 158 /* initialize the hardware */