diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-11-27 09:46:56 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-01-07 13:37:36 +1000 |
commit | 61b365a505d625734be9ac54066fe4700672abc9 (patch) | |
tree | e2c56d6757a32426b79e37869bf553551a096738 /drivers/gpu/drm/nouveau/core/include | |
parent | bdefc8cbdfc71ea73e0573dbd2d24c0a68232218 (diff) |
drm/nouveau: populate master subdev pointer only when fully constructed
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/include')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/include/subdev/fb.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h index 8541aa382ff2..d89dbdf39b0d 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h @@ -75,6 +75,11 @@ struct nouveau_fb { static inline struct nouveau_fb * nouveau_fb(void *obj) { + /* fbram uses this before device subdev pointer is valid */ + if (nv_iclass(obj, NV_SUBDEV_CLASS) && + nv_subidx(obj) == NVDEV_SUBDEV_FB) + return obj; + return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB]; } |