ast: fix falling back after kernel check

if we find a kernel driver the code leave the pci slot claimed which
stops us falling back. unclaim the pci slot. patch inspired by
correspondant patch for cirrus driver by Dave Airlie.

Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Stefan Dirsch
2014-03-18 11:58:39 +01:00
parent a40c98a483
commit e54f2fdb7a

View File

@@ -291,7 +291,10 @@ ASTProbe(DriverPtr drv, int flags)
devSections, numDevSections,
drv, &usedChips);
free(devSections);
if (numUsed <= 0) {
free(devSections);
return FALSE;
}
if (flags & PROBE_DETECT) {
if (numUsed > 0)
@@ -310,6 +313,8 @@ ASTProbe(DriverPtr drv, int flags)
pPci->device_id, pPci->bus, pPci->domain, pPci->dev, pPci->func);
xf86DrvMsg(0, X_ERROR,
"cirrus: This driver cannot operate until it has been unloaded.\n");
xf86UnclaimPciSlot(pPci, devSections[0]);
free(devSections);
return FALSE;
}
}
@@ -343,6 +348,7 @@ ASTProbe(DriverPtr drv, int flags)
} /* end of for-loop */
} /* end of if flags */
free(devSections);
free(usedChips);
return foundScreen;