Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6206877imm; Mon, 23 Jul 2018 13:29:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpde5iS8/EOCpVvu34w3gqH4ka0MU79ibKm+f8bdsfqKMuWLSnpk6g9wVn7nTxzGnAwyobbZ X-Received: by 2002:a63:735d:: with SMTP id d29-v6mr13672763pgn.156.1532377758901; Mon, 23 Jul 2018 13:29:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377758; cv=none; d=google.com; s=arc-20160816; b=wucB4vGfuGn/G53a6jlZLs72MhtG1WNPuTjUUQqs7/FbNXR2XooDmR8cvBySo2DgDr 16rgr6F5Yg67dId5P3FW59N9mgJGU21yZ9ArNM+5w93wE2ysY07YnN0niYcZWKnIufZ+ ZaSX6XhaRbEACUXzUNkoyuv1ej+pXhhwvyPHBwiCr6kB+yzM6RgkgD3ScACQqFa7+j1t b3wNPn0fzrCRvl0mD4P2iGU7QIzQoYnc9mhm3AXG00Jyhh00zR49Kb7kY+vWspjvTXu4 r74DJzdT4yLJ/k6x2PEolbAiw+WrwQFJlRINP06mVFnPiVwz23a+rhfjrVJNRCTDoJhN w27g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=K+KRj71D8DIyqKGBtYHGdW5nVxL+IKd+FJPhtF/LxhU=; b=krduwuCNDIJSadwqVb7bETcGaiNhOJ/n04pP4dl1KEWBvEeJwWbt7XEZpeNFnqQFjl m7QWtaaPbguWbgrYOu0htTtotwtZCmhR/syIgTIpzA+JBXqRCj03pQe24Wcbw147qvco UC3GHDvWqEBB2UcagaSNJsv7CIGZV68i4AkwR9YJECKikK9H5MBSqpaANyKBBmDtC+2V G5xtxt1MU9xLlXBikw8tDElrcBJUAqsVqsU3yG5uoZsp0AaF3VfJcvPrxVWuKeUe8wbu oQcr9eLyiN2FSm4pKYUzfkxN9U1S+do9CdViG9HOt6PRakN+TPPUqMXXUDszjpPhy79K /BgA== 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 n11-v6si9800345pgu.649.2018.07.23.13.29.04; Mon, 23 Jul 2018 13:29:18 -0700 (PDT) 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 S2388293AbeGWV3y (ORCPT + 99 others); Mon, 23 Jul 2018 17:29:54 -0400 Received: from sauhun.de ([88.99.104.3]:51260 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388271AbeGWV3w (ORCPT ); Mon, 23 Jul 2018 17:29:52 -0400 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 Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Jun Nie , Baoyou Xie , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-kernel@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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org And don't reimplement in the driver. Signed-off-by: Wolfram Sang --- 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; -- 2.11.0