diff options
author | 2023-06-01 12:03:38 +0300 | |
---|---|---|
committer | 2023-08-08 13:45:56 +0300 | |
commit | 757b90bbfa14191cbb8e5f15e313174d2100c38b (patch) | |
tree | db23c52dcda591e4df7b5013c065942b5b651c2b | |
parent | drm/i915/adls: s/ADLS_RPLS/RAPTORLAKE_S in platform and subplatform defines (diff) | |
download | wireguard-linux-757b90bbfa14191cbb8e5f15e313174d2100c38b.tar.xz wireguard-linux-757b90bbfa14191cbb8e5f15e313174d2100c38b.zip |
drm/i915/display: pre-initialize some values in probe_gmdid_display()
When intel_display_device_probe() (and, subsequently,
probe_gmdid_display()) returns, the caller expects ver, rel and step
to be initialized. Since there's no way to check that there was a
failure and no_display was returned without some further refactoring,
pre-initiliaze all these values to zero to keep it simple and safe.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230601090338.80284-1-luciano.coelho@intel.com
Diffstat (limited to '')
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_display_device.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_display_device.c b/drivers/gpu/drm/i915/display/intel_display_device.c index dcb272327281..23a301a87642 100644 --- a/drivers/gpu/drm/i915/display/intel_display_device.c +++ b/drivers/gpu/drm/i915/display/intel_display_device.c @@ -800,6 +800,15 @@ probe_gmdid_display(struct drm_i915_private *i915, u16 *ver, u16 *rel, u16 *step u32 val; int i; + /* The caller expects to ver, rel and step to be initialized + * here, and there's no good way to check when there was a + * failure and no_display was returned. So initialize all these + * values here zero, to be sure. + */ + *ver = 0; + *rel = 0; + *step = 0; + addr = pci_iomap_range(pdev, 0, i915_mmio_reg_offset(GMD_ID_DISPLAY), sizeof(u32)); if (!addr) { drm_err(&i915->drm, "Cannot map MMIO BAR to read display GMD_ID\n"); |