drm/nouveau/i2c: fix some blatant abuse
authorBen Skeggs <bskeggs@redhat.com>
Wed, 3 Dec 2014 08:47:09 +0000 (18:47 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 22 Jan 2015 02:14:45 +0000 (12:14 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
drivers/gpu/drm/nouveau/core/subdev/i2c/pad.h

index 0dc605db7ec8f7ab17d50c7d27ab72b1bc0d3128..e5f1ffaa6ef061fff944f5abf0b159c59c900336 100644 (file)
@@ -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;
 
index 452ac10c3004b4c79573fda9b714935e56aad72e..89aea46a7da1dfb70814246d77b3d01dde61ee93 100644 (file)
@@ -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;
 }