From patchwork Thu Oct 24 16:45:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11210257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 880A214ED for ; Thu, 24 Oct 2019 16:45:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70B4A21D71 for ; Thu, 24 Oct 2019 16:45:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70B4A21D71 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 701888984F; Thu, 24 Oct 2019 16:45:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5AB326E4B1 for ; Thu, 24 Oct 2019 16:45:43 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id g7so3593174wmk.4 for ; Thu, 24 Oct 2019 09:45:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5DYjBFdBkh2ExDAy5mIdVeU5TwdGnRp9l6pBdmT3a3c=; b=DB1O8mV/Pk8rJmJzm6siJMNnoVvGptwJhy0QE8mSIQ1OFa5V10rOmMLX50TesYkgI1 8iEp3vwIm95PUB+oblAsaKMMZZHtqBDs1wFKF6tJtuGScLTmU4K7Z2xsJjP6HmK6lbwU rP49MdmJS+4Rt44hFLh34wfguVFtX0Uok2W4b8Op4sli5P6xeZouBNmyn+ktmV4Sqt5e O5P8/1k9oPkaf3yB2IsZrsbPHWbXnwNs8nYgxOwCroRHPRkA8VbpG56PkRfEIbek0tHl gx7I2HG+5sHj5Eo/FaW0B6BtrI44ytDubrM5M5DQ19mlip932twhFVyevl/McaOYq7qW x44A== X-Gm-Message-State: APjAAAWGJZH5Cb4hHCoZfX9HnR61qmk5+7zYvPg4rhlCKnnLNsNmSene bZtOnDCn+KiSXp5IamJDNsj07cg7 X-Google-Smtp-Source: APXvYqwSeJIzZ3He6mdaGu8fUEI1GFMx1cvsK7/HbMJTKLryIrN8fCFQx4VE364WszsLtnqgveVxeA== X-Received: by 2002:a7b:c74a:: with SMTP id w10mr5368725wmk.173.1571935541531; Thu, 24 Oct 2019 09:45:41 -0700 (PDT) Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) by smtp.gmail.com with ESMTPSA id c189sm3953652wme.24.2019.10.24.09.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:45:40 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 02/32] drm/tegra: dp: Add drm_dp_link_reset() implementation Date: Thu, 24 Oct 2019 18:45:04 +0200 Message-Id: <20191024164534.132764-3-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191024164534.132764-1-thierry.reding@gmail.com> References: <20191024164534.132764-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5DYjBFdBkh2ExDAy5mIdVeU5TwdGnRp9l6pBdmT3a3c=; b=QQoIImawfuOekh1LfxlRAP4b6eF5hXLjNtWE1GNNfz7nRipP4eaowMSTELRpE0navZ muQr9OVrzQVdbMfdaqtOyQIBD+lh1WbFNMrXBF6CQr6hRyL9BmK4mEqItglK32v64GhY x6MsU1bNN+/+X/xZidb26xcqO12sqT4rn5oz+PoMChVNZaXVbtyo2P5JbE5GtvSmiuuN BpHQ80tBKtpgRxfXGkYyUJn1ZgFIEskEtqmftdviBPcC2L4tsRb3C/v6Q3G/Qs/Fgk3x 8nrFySjTg/JNkG+qVkz12y0jIE681ptcS9VGv3X7Pnqy97H81H/9J696YEeNk9V0EU/q dUOA== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding 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 --- drivers/gpu/drm/tegra/dp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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)