From 9458029940ffc64bca0c5a30ea626c377205842e Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 6 Jul 2012 12:14:00 +1000 Subject: drm/nouveau: implement module init functions in nouveau_drm.c These currently just call the existing ones in nouveau_drv.c, but will be extended in upcoming commits. This needed to be separated from the current code as there will be some header clashes until things are ported. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_state.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c') diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index 31c570c2bc3..f3bf14c2aa9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c @@ -33,7 +33,7 @@ #include #include "nouveau_drv.h" -#include "nouveau_drm.h" +#include #include "nouveau_agp.h" #include "nouveau_fbcon.h" #include @@ -1027,6 +1027,13 @@ static int nouveau_remove_conflicting_drivers(struct drm_device *dev) return 0; } +void * +nouveau_newpriv(struct drm_device *dev) +{ + struct drm_nouveau_private *dev_priv = dev->dev_private; + return dev_priv->newpriv; +} + int nouveau_load(struct drm_device *dev, unsigned long flags) { struct drm_nouveau_private *dev_priv; @@ -1039,6 +1046,7 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) ret = -ENOMEM; goto err_out; } + dev_priv->newpriv = dev->dev_private; dev->dev_private = dev_priv; dev_priv->dev = dev; @@ -1214,8 +1222,8 @@ err_ramin: err_mmio: iounmap(dev_priv->mmio); err_priv: + dev->dev_private = dev_priv->newpriv; kfree(dev_priv); - dev->dev_private = NULL; err_out: return ret; } @@ -1234,8 +1242,8 @@ int nouveau_unload(struct drm_device *dev) iounmap(dev_priv->mmio); iounmap(dev_priv->ramin); + dev->dev_private = dev_priv->newpriv; kfree(dev_priv); - dev->dev_private = NULL; return 0; } -- cgit v1.2.3-70-g09d2