summaryrefslogtreecommitdiff
path: root/sys/dev/i2c
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2022-01-22 11:49:16 +0000
committerthorpej <thorpej@NetBSD.org>2022-01-22 11:49:16 +0000
commit09eb5c43f131a6790fa9b46f440dd5a2d4ae03ae (patch)
treeffdfd13d89a9bfa56433c400ad83033887f60a5f /sys/dev/i2c
parent1c2752a686271470f2f20bdba60a27d2b6d5b8a8 (diff)
Change the devhandle_from_*() functions to also take a "super handle",
from which the newly created handle will inherit it's implementation. The root implementation for a new handle type is used if an invalid "super handle" is passed.
Diffstat (limited to 'sys/dev/i2c')
-rw-r--r--sys/dev/i2c/i2c.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c
index c6ef68e2019..f31abc9b4a9 100644
--- a/sys/dev/i2c/i2c.c
+++ b/sys/dev/i2c/i2c.c
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.82 2022/01/21 15:55:36 thorpej Exp $ */
+/* $NetBSD: i2c.c,v 1.83 2022/01/22 11:49:17 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
#endif /* _KERNEL_OPT */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.82 2022/01/21 15:55:36 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.83 2022/01/22 11:49:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -498,13 +498,15 @@ iic_attach(device_t parent, device_t self, void *aux)
devhandle = devhandle_invalid();
#ifdef I2C_USE_FDT
if (cookietype == I2C_COOKIE_OF) {
- devhandle = devhandle_from_of((int)cookie);
+ devhandle = devhandle_from_of(devhandle,
+ (int)cookie);
}
#endif /* I2C_USE_FDT */
#ifdef I2C_USE_ACPI
if (cookietype == I2C_COOKIE_ACPI) {
devhandle =
- devhandle_from_acpi((ACPI_HANDLE)cookie);
+ devhandle_from_acpi(devhandle,
+ (ACPI_HANDLE)cookie);
}
#endif /* I2C_USE_ACPI */