From patchwork Mon Sep 2 11:31:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11126427 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 6D5611398 for ; Mon, 2 Sep 2019 11:31:35 +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 55DC02173E for ; Mon, 2 Sep 2019 11:31:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55DC02173E 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 44B3789A0E; Mon, 2 Sep 2019 11:31:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5279889A0E for ; Mon, 2 Sep 2019 11:31:31 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id l11so4833719wrx.5 for ; Mon, 02 Sep 2019 04:31:31 -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=6cE/xv/U0fBPBmKtqaF9y7E9fzhVX7Pxsb5pN0WeB1I=; b=VzIq6ooSVruJ2pK8yrqM1J1FTSRr1Zbukk9Dl3NsK2t/gtsbstgV0B/j22th8HBD+J VzVV+1unK9DOlmffUKBvwPZZrIvJUGa0ZhJdLQY5I/bC45qoNzNvvDC8JsX+uAtIUf4F WMVwSjRzNyOudZbA5ah2gF5MDQhx1qoZsZn/YKmj1cRjUxuvbKsepNN8Y1+8GYN1O8pw 6yOE9QBkLgKBE0uYoRw5BX1Qpb9u0Vp+JSAqxtHjLt8GgXcFqiW/zy+yJp8SB+lluac3 kNOQCk0PIO/+DWATKeLk2ED8pFlXn7hHFECEeqRksDzX0EgBtl+214ND6x38zCzQcHo5 PbCw== X-Gm-Message-State: APjAAAW+FlIwxfVnRUK2GHC/NKgga0q2eaFGsqKzxI1LI5A6ZSQdEuxS jpGryqKdJ4fKEePSHzUJ6Ij0n6Jb X-Google-Smtp-Source: APXvYqxyHLaJ5erB59QfGTJT6pcjepbSVJ5kkThMyLzYtqT+j8u9al1pOr0Fc+6wDYmjxBQfjhAgCw== X-Received: by 2002:a5d:458b:: with SMTP id p11mr5821373wrq.160.1567423889605; Mon, 02 Sep 2019 04:31:29 -0700 (PDT) Received: from localhost (pD9E51890.dip0.t-ipconnect.de. [217.229.24.144]) by smtp.gmail.com with ESMTPSA id s19sm28105920wrb.94.2019.09.02.04.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Sep 2019 04:31:28 -0700 (PDT) From: Thierry Reding To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 03/21] drm/dp: Add drm_dp_link_reset() implementation Date: Mon, 2 Sep 2019 13:31:03 +0200 Message-Id: <20190902113121.31323-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190902113121.31323-1-thierry.reding@gmail.com> References: <20190902113121.31323-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=6cE/xv/U0fBPBmKtqaF9y7E9fzhVX7Pxsb5pN0WeB1I=; b=eTdMc1Ox+2Zub2dtyuJrYeQoINMd2P5sI2iGCrZTRaDovqs6F72LeEfaNQMpYhxr58 +3YsT7jMpK5u7RVM6GQqnWHpNqDzaMzJOAvghc8IvHQ05sHx7TYWTtoBAy5+53cAL2Rr +vejn2TLDSNe6PQLdL4dzrdx8+5oCjCRc69Rk7LFxrWygAuEiU+M25oU7NQXsKV+v5Lm aPznEX5SgJhfdeQqBLDFjww4vmWwAwsqk99rxxb1T3Fa9MRSXLaCM7YLXMAzjKym3s2u Q1owBpkE6KxR8Y9yU7xJjITASRjQEOHjqrERq4CyQSjq/hukG5eZ2EjVVyw285BcLCUm rWDA== 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: , 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/drm_dp_helper.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index ffc68d305afe..f5af71ec1b7d 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -336,6 +336,17 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux, } EXPORT_SYMBOL(drm_dp_dpcd_read_link_status); +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 @@ -352,7 +363,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)