From patchwork Mon Jul 23 20:26:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10540871 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 0D1F914BC for ; Mon, 23 Jul 2018 20:27:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F03D72848D for ; Mon, 23 Jul 2018 20:27:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E48A028495; Mon, 23 Jul 2018 20:27:22 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9D0472848D for ; Mon, 23 Jul 2018 20:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=MrXTlaVfj4vIYCx4/Zq0gOT3yMyxAxq/q0gpaOgZtOE=; b=R4ZrOXvk/g3DRFFilqYEOp2C3U GoCZ8JDLv7o1c4z0VSnzN3cRkSs7yDlSSo0ZqWOKQaOkD0oHPnGjUXGl2XBYHnECojIph0t/ZxoBc SQgSg8jlJWZrhHE/vdQ9E87GPUQTeulMBREjgIsnRDs6y/9uPETyVc2TBB7xNcW78DarzCRrt29Ds UZlD+NlZiPledDD0c13L3AvA7xive6AEf5cIq6ZMTJeceZkgMlvuW+TBVSZGQGbIOr5dfqGepBQZf 3jtxTPGuwKlhZSeGy5+EcVFcIeCdk2kPpjbdkclmHGINt8OYuqseMCOP6alafRpzCoKh4Z/IP+bRp V3HorqWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhhQM-0007uz-Cf; Mon, 23 Jul 2018 20:27:18 +0000 Received: from sauhun.de ([88.99.104.3] helo=pokefinder.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhhQB-0007iK-2q for linux-arm-kernel@lists.infradead.org; Mon, 23 Jul 2018 20:27:08 +0000 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 019D7631A4E; Mon, 23 Jul 2018 22:26:58 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Subject: [PATCH 09/12] i2c: zx2967: use core to detect 'no zero length' quirk Date: Mon, 23 Jul 2018 22:26:13 +0200 Message-Id: <20180723202617.15230-10-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180723202617.15230-1-wsa+renesas@sang-engineering.com> References: <20180723202617.15230-1-wsa+renesas@sang-engineering.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_132707_269530_40AF22C4 X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wolfram Sang , Jun Nie , Baoyou Xie , Shawn Guo , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP And don't reimplement in the driver. Signed-off-by: Wolfram Sang Acked-by: Shawn Guo --- Only build tested. drivers/i2c/busses/i2c-zx2967.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-zx2967.c b/drivers/i2c/busses/i2c-zx2967.c index 48281c1b30c6..b8f9e020d80e 100644 --- a/drivers/i2c/busses/i2c-zx2967.c +++ b/drivers/i2c/busses/i2c-zx2967.c @@ -281,9 +281,6 @@ static int zx2967_i2c_xfer_msg(struct zx2967_i2c *i2c, int ret; int i; - if (msg->len == 0) - return -EINVAL; - zx2967_i2c_flush_fifos(i2c); i2c->cur_trans = msg->buf; @@ -498,6 +495,10 @@ static const struct i2c_algorithm zx2967_i2c_algo = { .functionality = zx2967_i2c_func, }; +static const struct i2c_adapter_quirks zx2967_i2c_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN, +}; + static const struct of_device_id zx2967_i2c_of_match[] = { { .compatible = "zte,zx296718-i2c", }, { }, @@ -568,6 +569,7 @@ static int zx2967_i2c_probe(struct platform_device *pdev) strlcpy(i2c->adap.name, "zx2967 i2c adapter", sizeof(i2c->adap.name)); i2c->adap.algo = &zx2967_i2c_algo; + i2c->adap.quirks = &zx2967_i2c_quirks; i2c->adap.nr = pdev->id; i2c->adap.dev.parent = &pdev->dev; i2c->adap.dev.of_node = pdev->dev.of_node;