Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6207636imm; Mon, 23 Jul 2018 13:30:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeKzOYJ3FWEDsqmVlDaw1749CTy0soMKe2tZqYnL6LhRT8Xh0n1EMuf/CyCmbykvlZfhszI X-Received: by 2002:a63:a919:: with SMTP id u25-v6mr13971938pge.211.1532377823696; Mon, 23 Jul 2018 13:30:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377823; cv=none; d=google.com; s=arc-20160816; b=kbFDyzk9GtWG/l2r1Rp9gYPQZJbhNvb/5kwdCn3ozgh9YCVBMUHSDMGdbv0VPaNgB8 g5iHGlAd5OEtVqUFaA78uWGGCYzUQFaN6GZyJ4rfIoFj/+QW8C+kYcm76cBzj8DTGAkg 1ozKvCdQx9mCCGBnvou1q3PFQQkQmFlSBMUK9SDQSY/70C3dbs2rROClWq9jghlmuDGx CeIYKiIOPm8beEaOre4Vu2WY/rQV0+oZblLapkMPCQ1UcGEuFktEV8OHceNdKWd6F0vW hB6enfBcR/XL6AY4bXGRNR5uakxwU+wrr8yy+BxlCr2SkylDDfU2uCYZ3RhcRvN9kILc DURQ== 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=AqysBAiw9zcAfgw+eL5ltWTTIde4C4VpTjEtw6jLl3o=; b=ul9E3lKefqK0e/QxxncTL6lbxNFtZum1AjH7LlyBfmJRlQR+ed1MhZccCnpFbxil5E z7+uXeoIRYrFcUsDcYDT6UwCkWCCzjlPPpSeWdmcUNVt2f64l7gKfrevhIwwYPa+MeDq Yd1d4sdqjS2qjA3AGx+cSiOsT3JbTlfbxKHx5Ov6FhN7ZqL6NgmBeiLZWg7Pi/I4t8lf zo5kRVAfi6x724HNjBBuCp3Rc8+wfSn5ByzT3qr4MLIRv008RlLZQ+X2dvaYlGnwN8fc outg/hTcw13mUoolKPa8JXupQz8xp/ImYj2QFB8sUZbcchsHZwnHYAJsDBMGTej/oVFc CgUQ== 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 9-v6si9183879pgu.130.2018.07.23.13.30.09; Mon, 23 Jul 2018 13:30:23 -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 S2388219AbeGWV3u (ORCPT + 99 others); Mon, 23 Jul 2018 17:29:50 -0400 Received: from sauhun.de ([88.99.104.3]:51252 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388062AbeGWV3t (ORCPT ); Mon, 23 Jul 2018 17:29:49 -0400 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id C98B1631A4D; Mon, 23 Jul 2018 22:26:54 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Tony Lindgren , Aaro Koskinen , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/12] i2c: omap: use core to detect 'no zero length' quirk Date: Mon, 23 Jul 2018 22:26:08 +0200 Message-Id: <20180723202617.15230-5-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-omap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 65d06a819307..b1086bfb0465 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -661,9 +661,6 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap, dev_dbg(omap->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n", msg->addr, msg->len, msg->flags, stop); - if (msg->len == 0) - return -EINVAL; - omap->receiver = !!(msg->flags & I2C_M_RD); omap_i2c_resize_fifo(omap, msg->len, omap->receiver); @@ -1179,6 +1176,10 @@ static const struct i2c_algorithm omap_i2c_algo = { .functionality = omap_i2c_func, }; +static const struct i2c_adapter_quirks omap_i2c_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN, +}; + #ifdef CONFIG_OF static struct omap_i2c_bus_platform_data omap2420_pdata = { .rev = OMAP_I2C_IP_VERSION_1, @@ -1453,6 +1454,7 @@ omap_i2c_probe(struct platform_device *pdev) adap->class = I2C_CLASS_DEPRECATED; strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name)); adap->algo = &omap_i2c_algo; + adap->quirks = &omap_i2c_quirks; adap->dev.parent = &pdev->dev; adap->dev.of_node = pdev->dev.of_node; adap->bus_recovery_info = &omap_i2c_bus_recovery_info; -- 2.11.0