summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-03-03 16:07:16 +0100
committerHans de Goede <hdegoede@redhat.com>2014-03-10 09:08:06 +0100
commit76af81bdf8ade158d7cef718ff6cf31cbf641a9a (patch)
treed13461cacca7efba1aa29db36e2a553665601629 /hw
parent749d25f6f0faed00a4cd906171ea6f96d76591e7 (diff)
xf86platformBus: Make doPlatformProbe accept a NULL gdev argument
And use it from xf86platformAddDevice too, instead of directly calling drvp->platformProbe. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86platformBus.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 4447e19df..564567efc 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -312,13 +312,13 @@ static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp,
Bool foundScreen = FALSE;
int entity;
- if (gdev->screen == 0 && !xf86_check_platform_slot(dev))
+ if (gdev && gdev->screen == 0 && !xf86_check_platform_slot(dev))
return FALSE;
entity = xf86ClaimPlatformSlot(dev, drvp, 0,
- gdev, gdev->active);
+ gdev, gdev ? gdev->active : 0);
- if ((entity == -1) && (gdev->screen > 0)) {
+ if ((entity == -1) && gdev && (gdev->screen > 0)) {
unsigned nent;
for (nent = 0; nent < xf86NumEntities; nent++) {
@@ -420,7 +420,6 @@ xf86platformAddDevice(int index)
{
int i, old_screens, scr_index;
DriverPtr drvp = NULL;
- int entity;
screenLayoutPtr layout;
static const char *hotplug_driver_name = "modesetting";
@@ -440,11 +439,8 @@ xf86platformAddDevice(int index)
return -1;
old_screens = xf86NumGPUScreens;
- entity = xf86ClaimPlatformSlot(&xf86_platform_devices[index],
- drvp, 0, 0, 0);
- if (!drvp->platformProbe(drvp, entity, PLATFORM_PROBE_GPU_SCREEN, &xf86_platform_devices[index], 0)) {
- xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL);
- }
+ doPlatformProbe(&xf86_platform_devices[index], drvp, NULL,
+ PLATFORM_PROBE_GPU_SCREEN, 0);
if (old_screens == xf86NumGPUScreens)
return -1;
i = old_screens;