--- sys/powerpc/amigaone/platform_amigaone.c_MINE 2019-10-12 16:49:01.448465000 -0500 +++ sys/powerpc/amigaone/platform_amigaone.c 2019-10-12 17:48:45.996035000 -0500 @@ -60,8 +60,6 @@ DEFINE_CLASS_1(aeon, aeon_platform, aeon_methods, 0, m PLATFORM_DEF(aeon_platform); -static bool is_aeon; - static int aeon_probe(platform_t plat) { @@ -87,8 +85,7 @@ aeon_attach(platform_t plat) if (error) return (error); - is_aeon = true; - + config_intrhook_establish(&aeon_powerbutton_setup_hook); return (0); } @@ -105,12 +102,6 @@ aeon_setup_intr(void *unused) { int irq; - if (!is_aeon) - return; - - if (bootverbose) - printf("Configuring AmigaOne power button.\n"); - irq = 4; /* From TRM, IRQ4 is raised when power button is pressed. */ /* Get us the root PIC. */ @@ -118,6 +109,5 @@ aeon_setup_intr(void *unused) powerpc_config_intr(irq, INTR_TRIGGER_EDGE, INTR_POLARITY_LOW); powerpc_setup_intr("power_button", irq, NULL, aeon_pbutton_intr, NULL, INTR_TYPE_MISC, NULL, 0); + config_intrhook_disestablish(&aeon_powerbutton_setup_hook); } - -SYSINIT(aeon_setup_intr, SI_SUB_CONFIGURE, SI_ORDER_ANY, aeon_setup_intr, NULL);