summaryrefslogtreecommitdiff
path: root/sys/dev/acpi/chvgpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/acpi/chvgpio.c')
-rw-r--r--sys/dev/acpi/chvgpio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/acpi/chvgpio.c b/sys/dev/acpi/chvgpio.c
index 17267128b17..f3135584873 100644
--- a/sys/dev/acpi/chvgpio.c
+++ b/sys/dev/acpi/chvgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chvgpio.c,v 1.1 2016/05/07 23:10:50 kettenis Exp $ */
+/* $OpenBSD: chvgpio.c,v 1.2 2016/05/08 09:30:23 kettenis Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -209,6 +209,7 @@ chvgpio_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
return;
}
+ aml_freevalue(&res);
printf(" irq %d", sc->sc_irq);
@@ -216,14 +217,14 @@ chvgpio_attach(struct device *parent, struct device *self, void *aux)
if (bus_space_map(sc->sc_memt, sc->sc_addr, sc->sc_size, 0,
&sc->sc_memh)) {
printf(", can't map registers\n");
- goto fail;
+ return;
}
sc->sc_ih = acpi_intr_establish(sc->sc_irq, sc->sc_irq_flags, IPL_BIO,
chvgpio_intr, sc, sc->sc_dev.dv_xname);
if (sc->sc_ih == NULL) {
printf(", can't establish interrupt\n");
- goto fail;
+ goto unmap;
}
sc->sc_gpio.cookie = sc;
@@ -240,8 +241,8 @@ chvgpio_attach(struct device *parent, struct device *self, void *aux)
printf(", %d pins\n", sc->sc_npins);
return;
-fail:
- free(sc->sc_pin_ih, M_DEVBUF, sc->sc_npins * sizeof(*sc->sc_pin_ih));
+unmap:
+ bus_space_unmap(sc->sc_memt, sc->sc_memh, sc->sc_size);
}
int