diff --git a/sys/dev/i2c/i2c.c b/sys/dev/i2c/i2c.c index 6f46a132b47b..3a2bcad0da3e 100644 --- a/sys/dev/i2c/i2c.c +++ b/sys/dev/i2c/i2c.c @@ -1,4 +1,4 @@ -/* $NetBSD: i2c.c,v 1.52 2016/06/07 01:06:27 pgoyette Exp $ */ +/* $NetBSD: i2c.c,v 1.53 2016/07/23 17:42:37 jakllsch Exp $ */ /* * Copyright (c) 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ #endif #include -__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.52 2016/06/07 01:06:27 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.53 2016/07/23 17:42:37 jakllsch Exp $"); #include #include @@ -236,7 +236,7 @@ iic_attach(device_t parent, device_t self, void *aux) uint64_t cookie; const char *name; struct i2c_attach_args ia; - int loc[2]; + int loc[IICCF_NLOCS]; memset(loc, 0, sizeof loc); count = prop_array_count(child_devices); @@ -250,11 +250,11 @@ iic_attach(device_t parent, device_t self, void *aux) continue; if (!prop_dictionary_get_uint64(dev, "cookie", &cookie)) cookie = 0; - loc[0] = addr; + loc[IICCF_ADDR] = addr; if (prop_dictionary_get_uint32(dev, "size", &size)) - loc[1] = size; + loc[IICCF_SIZE] = size; else - loc[1] = -1; + loc[IICCF_SIZE] = -1; memset(&ia, 0, sizeof ia); ia.ia_addr = addr;