diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:15 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:37:37 +1000 |
commit | 33b1104b25f0e58ca56d6dd13ce917371a9115fe (patch) | |
tree | 67639b4e9c8d27aa402ae417dba802a02ee5c07f /bin/nv_aux.c | |
parent | 7ecff2076fd08dcc202e468385dec56002d32292 (diff) | |
download | nouveau-33b1104b25f0e58ca56d6dd13ce917371a9115fe.tar.gz |
nvif: simplify and tidy library interfaces
A variety of tweaks to the NVIF library interfaces, mostly ripping out
things that turned out to be not so useful.
- Removed refcounting from nvif_object, callers are expected to not be
stupid instead.
- nvif_client is directly reachable from anything derived from nvif_object,
removing the need for heuristics to locate it
- _new() versions of interfaces, that allocate memory for the object
they construct, have been removed. The vast majority of callers used
the embedded _init() interfaces.
- No longer storing constructor arguments (and the data returned from
nvkm) inside nvif_object, it's more or less unused and just wastes
memory.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'bin/nv_aux.c')
-rw-r--r-- | bin/nv_aux.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/nv_aux.c b/bin/nv_aux.c index 68b72cb2e..e3956f1bf 100644 --- a/bin/nv_aux.c +++ b/bin/nv_aux.c @@ -17,7 +17,8 @@ print_aux(struct nvkm_i2c_aux *aux) int main(int argc, char **argv) { - struct nvif_device *device; + struct nvif_client client; + struct nvif_device device; struct nvkm_i2c_aux *aux; struct nvkm_i2c *i2c; int action = -1, index = -1; @@ -63,11 +64,11 @@ main(int argc, char **argv) ret = u_device("lib", argv[0], "error", true, true, (1ULL << NVDEV_SUBDEV_VBIOS) | (1ULL << NVDEV_SUBDEV_I2C), - 0x00000000, &device); + 0x00000000, &client, &device); if (ret) return ret; - i2c = nvxx_i2c(device); + i2c = nvxx_i2c(&device); if (action < 0) { list_for_each_entry(aux, &i2c->aux, head) { @@ -102,6 +103,7 @@ main(int argc, char **argv) } done: - nvif_device_ref(NULL, &device); + nvif_device_fini(&device); + nvif_client_fini(&client); return ret; } |