From patchwork Tue Feb 26 19:36:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10831423 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B56351390 for ; Wed, 27 Feb 2019 08:56:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BBA82B002 for ; Wed, 27 Feb 2019 08:56:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8FE202C162; Wed, 27 Feb 2019 08:56:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1B3A82B002 for ; Wed, 27 Feb 2019 08:56:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EE3C46E03C; Wed, 27 Feb 2019 08:56:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0951D6E01C for ; Tue, 26 Feb 2019 19:36:40 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id l11so6669986pgq.10 for ; Tue, 26 Feb 2019 11:36:40 -0800 (PST) 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=pI4yPgzZ84XKblQbDTBB4uLpp98dYXickwI7aXAPp7g=; b=Zslej9DN+Vr89s1OXsCB6g6OmzZSMZEQ2rUfUOmKw6R1+WZhqAFYCzLAZUjwelDusT 89Ig2Svh8EQRy1C26dolmAkrDauw/HdbxeE+5aNBZvbLitdL1BGGBN3mWRe0T7HJrIwJ tFP+FsNw66XAPzn03Ypwug35Ctx7QiRAwzDrOOk6qXliPiTkSWEu87dq+IzJtCukbVqF 0oPy2cJmDGkhHY3xt+KjaoIMZC96D9Vd45dbCZKPiWR2mGO+VqTY0RpE9O05m/s5EyLd 8eUlc1/Zcy8r6e6WWPwNI+ZG40J1dkDaMAo6avoc31lANlDZ1IDHQhS+0QIdbxY5mooc LIHQ== X-Gm-Message-State: AHQUAuZlYlIwb0TXb00wl9c9bCKh3tPAmLcd9GNs8Sl/77E2gabikzKV eQs8tjbrXO1/N0XwtilP7jPFz9YzNY8= X-Google-Smtp-Source: AHgI3IYUHn9WI8cwRr5hkkvaU/rjwDIGjhsgBcNqz2rVnGfopvyQ6evHFqQtqAd9sXyppS4NO15leA== X-Received: by 2002:a62:1c94:: with SMTP id c142mr13121004pfc.54.1551209799170; Tue, 26 Feb 2019 11:36:39 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id l79sm28951220pfb.102.2019.02.26.11.36.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Feb 2019 11:36:38 -0800 (PST) From: Andrey Smirnov To: dri-devel@lists.freedesktop.org Subject: [PATCH 9/9] drm/bridge: tc358767: Drop tc_read() macro Date: Tue, 26 Feb 2019 11:36:09 -0800 Message-Id: <20190226193609.9862-10-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190226193609.9862-1-andrew.smirnov@gmail.com> References: <20190226193609.9862-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 27 Feb 2019 08:56:29 +0000 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=pI4yPgzZ84XKblQbDTBB4uLpp98dYXickwI7aXAPp7g=; b=HRAQFBbF4QmVvGC47md5YX6at4CuD5bSUC49t0NPvv9xLIOzAesexN13K5zTNXn3QH LC5tGeX0EhpEGkKRR3oezVqbsUhEv5DwHHMkqfU1nYwo3LV6K+pJitFv+/JKgzmGI5q1 dQS5bpk1K3a7Gf4B7n8eqkxY0w1fnZeeJtCnSOBEGD4xj9hosg10dKOsn/dCZz/40MMF qM5V+HfZ+LamJai8bDXkJ5E9AsLEHBRuLq7vhfKXrTamfgmTVWG0ZeWm9XAe6JztbeaM CDIQz34sqdow75da4CtVFuTDZUkuHaozuubUeT6VbifdJKNdX3u0Gw9YjKho0//YzpWW SJLw== 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: Andrey Smirnov , linux-kernel@vger.kernel.org, Laurent Pinchart , Chris Healy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP There's only one place where tc_read() is used, so it doesn't save us much. Drop it. No functional change intended. Signed-off-by: Andrey Smirnov Cc: Archit Taneja Cc: Andrzej Hajda Cc: Laurent Pinchart Cc: Chris Healy Cc: Lucas Stach Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org --- drivers/gpu/drm/bridge/tc358767.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 239b3aaa255d..3c574f1569aa 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -240,12 +240,6 @@ static inline struct tc_data *connector_to_tc(struct drm_connector *c) if (ret) \ goto err; \ } while (0) -#define tc_read(reg, var) \ - do { \ - ret = regmap_read(tc->regmap, reg, var); \ - if (ret) \ - goto err; \ - } while (0) static inline int tc_poll_timeout(struct regmap *map, unsigned int addr, unsigned int cond_mask, @@ -337,8 +331,13 @@ static ssize_t tc_aux_transfer(struct drm_dp_aux *aux, if (request == DP_AUX_I2C_READ || request == DP_AUX_NATIVE_READ) { /* Read data */ while (i < size) { - if ((i % 4) == 0) - tc_read(DP0_AUXRDATA(i >> 2), &tmp); + if ((i % 4) == 0) { + ret = regmap_read(tc->regmap, + DP0_AUXRDATA(i >> 2), + &tmp); + if (ret) + goto err; + } buf[i] = tmp & 0xff; tmp = tmp >> 8; i++;