drm/nouveau/device/tegra: fix uninitialized IRQ number
authorAlexandre Courbot <acourbot@nvidia.com>
Thu, 28 Jan 2016 03:30:06 +0000 (12:30 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 14 Mar 2016 00:11:06 +0000 (10:11 +1000)
nvkm_device_tegra_new initializes the irq member of the Tegra device
to -1 in order to signal that it is uninitialized. However,
nvkm_device_tegra_fini tests it against 0 to check whether an IRQ has
been allocated or not. This leads to free_irq being called on -1 during
device initialization.

Fix this by using 0 as the uninitialized value everywhere.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c

index e7e581d6a8ff24d256b6526d2b93c41b7a00daa3..92cc7c685eda9d8966fd6b2d0599b82ff288b6b0 100644 (file)
@@ -255,7 +255,6 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func,
 
        tdev->func = func;
        tdev->pdev = pdev;
-       tdev->irq = -1;
 
        tdev->vdd = devm_regulator_get(&pdev->dev, "vdd");
        if (IS_ERR(tdev->vdd)) {