summaryrefslogtreecommitdiff
path: root/nvkm
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-03 18:47:09 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-10 23:57:06 +1000
commit8e67a73556a25a96343a681ab83fb4fd7f73bdeb (patch)
tree217cde20a63c497036e3708f27894966cd01d422 /nvkm
parent5e5a63a1a78b75128ccd31f802c2b37d8878442d (diff)
downloadnouveau-8e67a73556a25a96343a681ab83fb4fd7f73bdeb.tar.gz
i2c: fix some blatant abuse
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm')
-rw-r--r--nvkm/subdev/i2c/base.c4
-rw-r--r--nvkm/subdev/i2c/pad.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/nvkm/subdev/i2c/base.c b/nvkm/subdev/i2c/base.c
index 0dc605db7..e5f1ffaa6 100644
--- a/nvkm/subdev/i2c/base.c
+++ b/nvkm/subdev/i2c/base.c
@@ -494,8 +494,8 @@ nouveau_i2c_create_port(struct nouveau_i2c *i2c, int index, u8 type,
oclass = impl->pad_x;
}
- ret = nouveau_object_ctor(NULL, nv_object(i2c), oclass, NULL, pad,
- &parent);
+ ret = nouveau_object_ctor(nv_object(i2c), nv_object(i2c), oclass,
+ NULL, pad, &parent);
if (ret < 0)
return;
diff --git a/nvkm/subdev/i2c/pad.h b/nvkm/subdev/i2c/pad.h
index 452ac10c3..89aea46a7 100644
--- a/nvkm/subdev/i2c/pad.h
+++ b/nvkm/subdev/i2c/pad.h
@@ -14,7 +14,7 @@ static inline struct nvkm_i2c_pad *
nvkm_i2c_pad(struct nouveau_i2c_port *port)
{
struct nouveau_object *pad = nv_object(port);
- while (pad->parent)
+ while (!nv_iclass(pad->parent, NV_SUBDEV_CLASS))
pad = pad->parent;
return (void *)pad;
}