drm/nouveau: Unregister switcheroo client on exit
authorAndreas Heider <andreas@meetr.de>
Sun, 20 May 2012 23:14:51 +0000 (00:14 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 24 May 2012 06:56:36 +0000 (16:56 +1000)
Currently nouveau only registers as a vga_switcheroo client, but never
unregisters. This patch adds the necessary unregister calls.

Signed-off-by: Andreas Heider <andreas@meetr.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_state.c

index e23c05348aa02881fb6f298a6572036b4ed34c6b..19706f0532eac60deb973b0b994ad0065a04f980 100644 (file)
@@ -840,6 +840,7 @@ out_bios:
 out_display_early:
        engine->display.late_takedown(dev);
 out:
+       vga_switcheroo_unregister_client(dev->pdev);
        vga_client_register(dev->pdev, NULL, NULL, NULL);
        return ret;
 }
@@ -895,6 +896,7 @@ static void nouveau_card_takedown(struct drm_device *dev)
 
        nouveau_irq_fini(dev);
 
+       vga_switcheroo_unregister_client(dev->pdev);
        vga_client_register(dev->pdev, NULL, NULL, NULL);
 }