drm/nouveau/pmu: make sure the reset hook exists before running it

Some PMU implementations (in particular the ones managed by secure
boot) may not have a reset() hook. Make sure we don't crash in that
case.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Alexandre Courbot 2016-11-17 16:37:29 +09:00 committed by Ben Skeggs
parent ba735d061d
commit 485a20eff2

View File

@ -85,6 +85,7 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
); );
/* Reset. */ /* Reset. */
if (pmu->func->reset)
pmu->func->reset(pmu); pmu->func->reset(pmu);
/* Wait for IMEM/DMEM scrubbing to be complete. */ /* Wait for IMEM/DMEM scrubbing to be complete. */