summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra/dp.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-12-03 13:44:17 +0300
committerThierry Reding <treding@nvidia.com>2019-10-28 13:18:44 +0300
commit1abd6b3304d47ff055063e0d59fc03bb27e0e196 (patch)
treee6b2b4d4481e319d182621f1e58849dfdd7d7a09 /drivers/gpu/drm/tegra/dp.c
parent0fa5c1bdd2f7dfc3cc5a9b22470fb4ffdbe22272 (diff)
downloadlinux-1abd6b3304d47ff055063e0d59fc03bb27e0e196.tar.xz
drm/tegra: dp: Add drm_dp_link_reset() implementation
Subsequent patches will add non-volatile fields to struct drm_dp_link, so introduce a function to zero out only the volatile fields. Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/dp.c')
-rw-r--r--drivers/gpu/drm/tegra/dp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/dp.c b/drivers/gpu/drm/tegra/dp.c
index 50ba967ebcbd..c19060b8753a 100644
--- a/drivers/gpu/drm/tegra/dp.c
+++ b/drivers/gpu/drm/tegra/dp.c
@@ -8,6 +8,17 @@
#include "dp.h"
+static void drm_dp_link_reset(struct drm_dp_link *link)
+{
+ if (!link)
+ return;
+
+ link->revision = 0;
+ link->rate = 0;
+ link->num_lanes = 0;
+ link->capabilities = 0;
+}
+
/**
* drm_dp_link_probe() - probe a DisplayPort link for capabilities
* @aux: DisplayPort AUX channel
@@ -24,7 +35,7 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link)
u8 values[3];
int err;
- memset(link, 0, sizeof(*link));
+ drm_dp_link_reset(link);
err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values));
if (err < 0)