bbswitch: don't disable card if a driver is loaded

This commit is contained in:
Lekensteyn 2011-12-12 17:00:06 +01:00
parent f7e6dd9741
commit b50902797a

View File

@ -108,6 +108,14 @@ static void bbswitch_off(void) {
if (is_card_disabled())
return;
// to prevent the system from possibly locking up, don't disable the device
// if it's still in use by a driver (i.e. nouveau or nvidia)
if (dis_dev->driver) {
printk(KERN_WARNING "bbswitch: device %s is in use by driver '%s', "
"refusing OFF", dev_name(&dis_dev->dev), dis_dev->driver->name);
return;
}
printk(KERN_INFO "bbswitch: disabling discrete graphics\n");
bbswitch_acpi_off();