Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/thorpej-i2c-spi-conf]: src/sys/dev/i2c ia->ia_cookie -> devhandle_to_of(...
details: https://anonhg.NetBSD.org/src/rev/77c447b39d3c
branches: thorpej-i2c-spi-conf
changeset: 983203:77c447b39d3c
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sat May 08 16:46:43 2021 +0000
description:
ia->ia_cookie -> devhandle_to_of(device_handle(self))
diffstat:
sys/dev/i2c/ac100.c | 6 +++---
sys/dev/i2c/adadc.c | 10 +++++-----
sys/dev/i2c/anxedp.c | 6 +++---
sys/dev/i2c/as3722.c | 6 +++---
sys/dev/i2c/axp20x.c | 6 +++---
sys/dev/i2c/axppmic.c | 6 +++---
sys/dev/i2c/cwfg.c | 6 +++---
sys/dev/i2c/es8316ac.c | 8 ++++----
sys/dev/i2c/fan53555.c | 6 +++---
sys/dev/i2c/fcu.c | 19 +++++++++----------
sys/dev/i2c/max77620.c | 6 +++---
sys/dev/i2c/pca9685.c | 6 +++---
sys/dev/i2c/pcf8563.c | 7 ++++---
sys/dev/i2c/rkpmic.c | 6 +++---
sys/dev/i2c/sy8106a.c | 6 +++---
sys/dev/i2c/tcagpio.c | 6 +++---
sys/dev/i2c/tcakp.c | 6 +++---
sys/dev/i2c/tda19988.c | 6 +++---
sys/dev/i2c/tps65217pmic.c | 6 +++---
sys/dev/i2c/twl4030.c | 6 +++---
20 files changed, 70 insertions(+), 70 deletions(-)
diffs (truncated from 615 to 300 lines):
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/ac100.c
--- a/sys/dev/i2c/ac100.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/ac100.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ac100.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: ac100.c,v 1.7.4.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_fdt.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.7 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ac100.c,v 1.7.4.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -153,7 +153,7 @@
sc->sc_todr.cookie = sc;
#ifdef FDT
- const int phandle = ia->ia_cookie;
+ const int phandle = devhandle_to_of(device_handle(self));
const int rtc_phandle = of_find_firstchild_byname(phandle, "rtc");
if (rtc_phandle > 0)
fdtbus_todr_attach(self, rtc_phandle, &sc->sc_todr);
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/adadc.c
--- a/sys/dev/i2c/adadc.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/adadc.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: adadc.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: adadc.c,v 1.10.4.1 2021/05/08 16:56:10 thorpej Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.10 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.10.4.1 2021/05/08 16:56:10 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -128,6 +128,7 @@
struct i2c_attach_args *ia = aux;
envsys_data_t *s;
int error, ch;
+ int phandle;
uint32_t eeprom[40];
char loc[256];
int which_cpu;
@@ -151,8 +152,8 @@
* should probably just expose the temperature and four ENVSYS_INTEGERs
*/
which_cpu = 0;
- ch = OF_child(ia->ia_cookie);
- while (ch != 0) {
+ phandle = devhandle_to_of(device_handle(self));
+ for (ch = OF_child(phandle); ch != 0; ch = OF_peer(ch)) {
if (OF_getprop(ch, "location", loc, 32) > 0) {
int reg = 0;
OF_getprop(ch, "reg", ®, sizeof(reg));
@@ -185,7 +186,6 @@
sysmon_envsys_sensor_attach(sc->sc_sme, s);
sc->sc_nsensors++;
}
- ch = OF_peer(ch);
}
aprint_debug_dev(self, "monitoring CPU %d\n", which_cpu);
error = get_cpuid(which_cpu, (uint8_t *)eeprom);
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/anxedp.c
--- a/sys/dev/i2c/anxedp.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/anxedp.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: anxedp.c,v 1.6.4.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: anxedp.c,v 1.6.4.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -434,7 +434,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
aprint_naive("\n");
aprint_normal(": eDP TX\n");
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/as3722.c
--- a/sys/dev/i2c/as3722.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/as3722.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: as3722.c,v 1.23 2021/04/24 23:36:54 thorpej Exp $ */
+/* $NetBSD: as3722.c,v 1.23.2.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2015 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
#include "opt_fdt.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.23 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: as3722.c,v 1.23.2.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -261,7 +261,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
aprint_naive("\n");
aprint_normal(": AMS AS3722\n");
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/axp20x.c
--- a/sys/dev/i2c/axp20x.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/axp20x.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: axp20x.c,v 1.20 2021/04/24 23:36:54 thorpej Exp $ */
+/* $NetBSD: axp20x.c,v 1.20.2.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.20 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axp20x.c,v 1.20.2.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -241,7 +241,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
error = axp20x_read(sc, AXP_INPUT_STATUS,
&sc->sc_inputstatus, 1);
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/axppmic.c
--- a/sys/dev/i2c/axppmic.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/axppmic.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: axppmic.c,v 1.34 2021/04/24 23:36:54 thorpej Exp $ */
+/* $NetBSD: axppmic.c,v 1.34.2.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2014-2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.34 2021/04/24 23:36:54 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: axppmic.c,v 1.34.2.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -955,7 +955,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
sc->sc_conf = c;
aprint_naive("\n");
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/cwfg.c
--- a/sys/dev/i2c/cwfg.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/cwfg.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cwfg.c,v 1.4 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: cwfg.c,v 1.4.4.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2020 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cwfg.c,v 1.4 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cwfg.c,v 1.4.4.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -418,7 +418,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
cwfg_lock(sc);
error = cwfg_read(sc, VERSION_REG, &ver);
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/es8316ac.c
--- a/sys/dev/i2c/es8316ac.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/es8316ac.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: es8316ac.c,v 1.5 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: es8316ac.c,v 1.5.4.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2020 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: es8316ac.c,v 1.5 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: es8316ac.c,v 1.5.4.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -690,12 +690,12 @@
{
struct escodec_softc * const sc = device_private(self);
struct i2c_attach_args * const ia = aux;
- const int phandle = ia->ia_cookie;
+ const int phandle = devhandle_to_of(device_handle(self));
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
sc->sc_swvol = 0xff;
sc->sc_clk = fdtbus_clock_get(phandle, "mclk");
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/fan53555.c
--- a/sys/dev/i2c/fan53555.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/fan53555.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fan53555.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: fan53555.c,v 1.9.4.1 2021/05/08 16:46:43 thorpej Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fan53555.c,v 1.9 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fan53555.c,v 1.9.4.1 2021/05/08 16:46:43 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -307,7 +307,7 @@
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
sc->sc_addr = ia->ia_addr;
- sc->sc_phandle = ia->ia_cookie;
+ sc->sc_phandle = devhandle_to_of(device_handle(self));
compat = iic_compatible_lookup(ia, compat_data);
KASSERT(compat != NULL);
diff -r 3912c7662df7 -r 77c447b39d3c sys/dev/i2c/fcu.c
--- a/sys/dev/i2c/fcu.c Sat May 08 15:51:30 2021 +0000
+++ b/sys/dev/i2c/fcu.c Sat May 08 16:46:43 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fcu.c,v 1.12 2021/01/27 02:29:48 thorpej Exp $ */
+/* $NetBSD: fcu.c,v 1.12.4.1 2021/05/08 16:56:10 thorpej Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.12 2021/01/27 02:29:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.12.4.1 2021/05/08 16:56:10 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -141,6 +141,7 @@
struct fcu_softc *sc = device_private(self);
struct i2c_attach_args *ia = aux;
int have_eeprom1 = 1;
+ int phandle;
sc->sc_dev = self;
sc->sc_i2c = ia->ia_tag;
@@ -185,11 +186,11 @@
sc->sc_nfans = 0;
/* round up sensors */
+ phandle = devhandle_to_of(device_handle(self));
int ch;
Home |
Main Index |
Thread Index |
Old Index