Module Name: src
Committed By: jmcneill
Date: Sun Jul 1 21:22:16 UTC 2018
Modified Files:
src/sys/arch/arm/samsung: exynos_i2c.c
Log Message:
Use fdtbus_attach_i2cbus
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/samsung/exynos_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/arch/arm/samsung/exynos_i2c.c
diff -u src/sys/arch/arm/samsung/exynos_i2c.c:1.14 src/sys/arch/arm/samsung/exynos_i2c.c:1.15
--- src/sys/arch/arm/samsung/exynos_i2c.c:1.14 Wed May 9 02:53:00 2018
+++ src/sys/arch/arm/samsung/exynos_i2c.c Sun Jul 1 21:22:16 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_i2c.c,v 1.14 2018/05/09 02:53:00 thorpej Exp $ */
+/* $NetBSD: exynos_i2c.c,v 1.15 2018/07/01 21:22:16 jmcneill Exp $ */
/*
* Copyright (c) 2015 Jared D. McNeill <[email protected]>
@@ -31,7 +31,7 @@
#include "opt_arm_debug.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.14 2018/05/09 02:53:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_i2c.c,v 1.15 2018/07/01 21:22:16 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -67,7 +67,6 @@ struct exynos_i2c_softc {
struct i2c_controller sc_ic;
kmutex_t sc_lock;
kcondvar_t sc_cv;
- device_t sc_i2cdev;
};
static int exynos_i2c_intr(void *);
@@ -137,9 +136,6 @@ exynos_i2c_attach(device_t parent, devic
struct exynos_i2c_softc * const sc = device_private(self);
struct fdt_attach_args * const faa = aux;
const int phandle = faa->faa_phandle;
- struct i2cbus_attach_args iba;
- prop_dictionary_t devs;
- uint32_t address_cells;
char intrstr[128];
bus_addr_t addr;
bus_size_t size;
@@ -188,19 +184,7 @@ exynos_i2c_attach(device_t parent, devic
fdtbus_register_i2c_controller(self, phandle, &exynos_i2c_funcs);
- 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 = &sc->sc_ic;
- iba.iba_child_devices = prop_dictionary_get(devs, "i2c-child-devices");
- if (iba.iba_child_devices != NULL)
- prop_object_retain(iba.iba_child_devices);
- prop_object_release(devs);
-
- sc->sc_i2cdev = config_found_ia(self, "i2cbus", &iba, iicbus_print);
+ fdtbus_attach_i2cbus(self, phandle, &sc->sc_ic, iicbus_print);
}
static i2c_tag_t