summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_state.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-07-06 12:14:00 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-10-03 13:12:44 +1000
commit9458029940ffc64bca0c5a30ea626c377205842e (patch)
treea677d326bca8e031d47b859006f9c6e71de225ad /drivers/gpu/drm/nouveau/nouveau_state.c
parent9274f4a9ba7e70d1770e237fca16d52f27f0c728 (diff)
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 <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_state.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c14
1 files changed, 11 insertions, 3 deletions
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 <linux/vga_switcheroo.h>
#include "nouveau_drv.h"
-#include "nouveau_drm.h"
+#include <nouveau_drm.h>
#include "nouveau_agp.h"
#include "nouveau_fbcon.h"
#include <core/ramht.h>
@@ -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;
}