drm/nouveau: Check dsm on switcheroo unregister
commit2f3787aa439ae0d34e4658400c1139a7541bec1d
authorAndreas Heider <andreas@meetr.de>
Sun, 20 May 2012 23:14:50 +0000 (21 00:14 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 24 May 2012 06:56:34 +0000 (24 16:56 +1000)
treeb0465658f2a4593eea40af2d1865917490b5d432
parent42eddbd7b2b5cc9bbb4c918a3294b6ee9dd53c59
drm/nouveau: Check dsm on switcheroo unregister

Currently vga_switcheroo_unregister_handler is called unconditionally when
nouveau is unloaded, even when nouveau never registered a handler. This
interferes with other switcheroo handlers, as vga_switcheroo doesn't check who
called unregister_handler, but simply unregisters the current handler. This
patch adds a check so unregister is only called if a handler was registered by
nouveau before.

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