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
1 changed files with 2 additions and 1 deletions

View File

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