Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6953138imu; Mon, 3 Dec 2018 05:35:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/VJ3WKo07/2HVdYgQQtsEKA9RhE69TRUZ4zK6kXgVD9bvNhPjzuhGudE3XUp8NFiU3OiSr6 X-Received: by 2002:a62:2a4b:: with SMTP id q72mr15709831pfq.61.1543844113830; Mon, 03 Dec 2018 05:35:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543844113; cv=none; d=google.com; s=arc-20160816; b=jm7hEtE/W70P56eUgiApKd/c15jV0tXo+N9/qUgmjCSSx45crozDchrananR9xbMMN tGQT16DvH9eHmY3VJSUhK6f6jHzhNqV6LQTj/dy67GMJ3POiifFu8ulVs4+IB/efAkby e1suhMV14ZSoO7JK+3Tv3Ffqm7mw4KMxTbTvvurhKIn00Bv7D/XnMZ3UkyqJ5woJXtYk VXNEZy2p/lhi9/dR9Bdig0RkwlynelQYQcDVSE2PIHRLUEUwSyTc25x2BWn92vs20uaJ YMAcDWXqFjf64gWJd/ilMA1FgfXMgB0eFAdYVtbX/MDDUkj1h4vNKDP3siXn2gXTPo7y Scgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=/lovKvmZChUPkdCM9o4eX9/TmVrhgmgPyXFahJcrRpI=; b=M++OggpeaYkffMq2Pw1YgVeUxeWFQpHMXjMztzpFnAS3Dde0AvZDnPiF3D8kfrlipD nHs1xbA5Frwlu540SXiVL0wOvnqHkwV+tGCfpCFb7pBhXnGp6YjSigT0KvayRohx/hIa I/4OepstGMy+X9vqPshy2DwHZaCBFGocbNr6y3bFZ9OsZpi3Sp7AczeqskzPRlL+3fhc AbxZ5B/PPbBfppaPiISVIB7AYSlzErHcJEd+3olmiLV4b3zgHzWOKBZh/ifqqpqSKkup eRnhg+1IKLhWPnT4wwiy7AcYQJSIOLVZDlDNyBahA1/+Z4pp+bWUZQRr5yt2WbhZgQ7P RSbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c132si12102290pga.597.2018.12.03.05.34.57; Mon, 03 Dec 2018 05:35:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726643AbeLCNeo (ORCPT + 99 others); Mon, 3 Dec 2018 08:34:44 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:40636 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725867AbeLCNen (ORCPT ); Mon, 3 Dec 2018 08:34:43 -0500 X-UUID: 4c2c5a6177de4ddea95e434658bf045b-20181203 X-UUID: 4c2c5a6177de4ddea95e434658bf045b-20181203 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1093234821; Mon, 03 Dec 2018 21:33:22 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 3 Dec 2018 21:33:13 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 3 Dec 2018 21:33:13 +0800 From: To: CC: , , , , , , , , Subject: [PATCH 2/5] i2c: mediatek: remove useless code and replace definitions Date: Mon, 3 Dec 2018 21:32:51 +0800 Message-ID: <1543843974-4054-3-git-send-email-qii.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1543843974-4054-1-git-send-email-qii.wang@mediatek.com> References: <1543843974-4054-1-git-send-email-qii.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 96542F084A7B41856A9BCC3EA707BFFA2BB1E33880D4F72E327DA73DD87F6D582000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: qii wang Completion_done is useless when we don't use its return value, so we remove it. Different speeds have been defined by macros, so we use macros definitions. Signed-off-by: qii wang --- drivers/i2c/busses/i2c-mt65xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c index a74ef76..660de1e 100644 --- a/drivers/i2c/busses/i2c-mt65xx.c +++ b/drivers/i2c/busses/i2c-mt65xx.c @@ -456,7 +456,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, control_reg = readw(i2c->base + OFFSET_CONTROL) & ~(I2C_CONTROL_DIR_CHANGE | I2C_CONTROL_RS); - if ((i2c->speed_hz > 400000) || (left_num >= 1)) + if ((i2c->speed_hz > MAX_FS_MODE_SPEED) || (left_num >= 1)) control_reg |= I2C_CONTROL_RS; if (i2c->op == I2C_MASTER_WRRD) @@ -465,7 +465,7 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, writew(control_reg, i2c->base + OFFSET_CONTROL); /* set start condition */ - if (i2c->speed_hz <= 100000) + if (i2c->speed_hz <= I2C_DEFAULT_SPEED) writew(I2C_ST_START_CON, i2c->base + OFFSET_EXT_CONF); else writew(I2C_FS_START_CON, i2c->base + OFFSET_EXT_CONF); @@ -642,8 +642,6 @@ static int mtk_i2c_do_transfer(struct mtk_i2c *i2c, struct i2c_msg *msgs, return -ETIMEDOUT; } - completion_done(&i2c->msg_complete); - if (i2c->irq_stat & (I2C_HS_NACKERR | I2C_ACKERR)) { dev_dbg(i2c->dev, "addr: %x, transfer ACK error\n", msgs->addr); mtk_i2c_init_hw(i2c); -- 1.7.9.5