Module Name:    src
Committed By:   jmcneill
Date:           Sat Oct 23 17:46:26 UTC 2021

Modified Files:
        src/sys/dev/acpi: com_acpi.c

Log Message:
Poll only if we don't have an IRQ resource.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/acpi/com_acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/acpi/com_acpi.c
diff -u src/sys/dev/acpi/com_acpi.c:1.43 src/sys/dev/acpi/com_acpi.c:1.44
--- src/sys/dev/acpi/com_acpi.c:1.43	Thu Oct 21 00:56:52 2021
+++ src/sys/dev/acpi/com_acpi.c	Sat Oct 23 17:46:26 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $ */
+/* $NetBSD: com_acpi.c,v 1.44 2021/10/23 17:46:26 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2002 Jared D. McNeill <jmcne...@invisible.ca>
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.43 2021/10/21 00:56:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.44 2021/10/23 17:46:26 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -150,8 +150,7 @@ com_acpi_attach(device_t parent, device_
 	/* find our IRQ */
 	irq = acpi_res_irq(&res, 0);
 	if (irq == NULL) {
-		aprint_error_dev(self, "unable to find irq resource\n");
-		goto out;
+		sc->sc_poll_ticks = 1;
 	}
 
 	if (!com_is_console(iot, base, &ioh))
@@ -175,13 +174,9 @@ com_acpi_attach(device_t parent, device_
 
 	sc->sc_type = dce->value;
 
-	if (sc->sc_type == COM_TYPE_DW_APB) {
-		sc->sc_poll_ticks = 1;	/* XXX */
-	} else {
-		if (com_probe_subr(&sc->sc_regs) == 0) {
-			aprint_error(": com probe failed\n");
-			goto out;
-		}
+	if (com_probe_subr(&sc->sc_regs) == 0) {
+		aprint_error(": com probe failed\n");
+		goto out;
 	}
 
 	rv = acpi_dsd_integer(aa->aa_node->ad_handle, "clock-frequency",
@@ -193,10 +188,11 @@ com_acpi_attach(device_t parent, device_
 
 	com_attach_subr(sc);
 
-	if (sc->sc_poll_ticks == 0)
+	if (sc->sc_poll_ticks == 0) {
 		asc->sc_ih = acpi_intr_establish(self,
 		    (uint64_t)(uintptr_t)aa->aa_node->ad_handle,
 		    IPL_SERIAL, true, comintr, sc, device_xname(self));
+	}
 
 	if (!pmf_device_register(self, NULL, com_resume))
 		aprint_error_dev(self, "couldn't establish a power handler\n");

Reply via email to