Module Name: src Committed By: thorpej Date: Sun Apr 25 22:20:08 UTC 2021
Modified Files: src/sys/dev/fdt [thorpej-i2c-spi-conf]: fdt_i2c.c Log Message: - Don't call of_enter_i2c_devs() -- it no longer exists. - Pass along the provided devhandle to the i2c bus instance. XXX fdtbus_attach_i2cbus() is now just a thin wrapper around config_found() and should probably just go away in favor of making FDT-attached i2c controller drivers consistent with everyone else. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.2.1 src/sys/dev/fdt/fdt_i2c.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/fdt/fdt_i2c.c diff -u src/sys/dev/fdt/fdt_i2c.c:1.10 src/sys/dev/fdt/fdt_i2c.c:1.10.2.1 --- src/sys/dev/fdt/fdt_i2c.c:1.10 Sat Apr 24 23:36:53 2021 +++ src/sys/dev/fdt/fdt_i2c.c Sun Apr 25 22:20:08 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt_i2c.c,v 1.10 2021/04/24 23:36:53 thorpej Exp $ */ +/* $NetBSD: fdt_i2c.c,v 1.10.2.1 2021/04/25 22:20:08 thorpej Exp $ */ /*- * Copyright (c) 2015 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.10 2021/04/24 23:36:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.10.2.1 2021/04/25 22:20:08 thorpej Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -102,31 +102,12 @@ device_t fdtbus_attach_i2cbus(device_t dev, int phandle, i2c_tag_t tag, cfprint_t print) { struct i2cbus_attach_args iba; - prop_dictionary_t devs, props; - device_t ret; - u_int address_cells; - - devs = prop_dictionary_create(); - if (of_getprop_uint32(phandle, "#address-cells", &address_cells)) - address_cells = 1; - - of_enter_i2c_devs(devs, phandle, address_cells * 4, 0); memset(&iba, 0, sizeof(iba)); iba.iba_tag = tag; - iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices"); - if (iba.iba_child_devices) - prop_object_retain(iba.iba_child_devices); - prop_object_release(devs); - - props = device_properties(dev); - prop_dictionary_set_bool(props, "i2c-no-indirect-config", true); - ret = config_found(dev, &iba, print, + return config_found(dev, &iba, print, CFARG_IATTR, "i2cbus", + CFARG_DEVHANDLE, devhandle_from_of(phandle), CFARG_EOL); - if (iba.iba_child_devices) - prop_object_release(iba.iba_child_devices); - - return ret; }