Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6207019imm; Mon, 23 Jul 2018 13:29:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcM2rnMAdgWHs+q+grLCavmgEZ4iez6Yqp5/FIaVu4JPHfZ5RywBOf5mnvvrRnVcj5RW/L1 X-Received: by 2002:a63:ab4c:: with SMTP id k12-v6mr13415824pgp.386.1532377772590; Mon, 23 Jul 2018 13:29:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377772; cv=none; d=google.com; s=arc-20160816; b=JfJWarMIf2jBNGaDe06ptw653yIaSeBH+MVobfKUxoUP/P7j5KBjfIUdrDgR6LG9VP ScdrFp7i/pUbpkaMVkb+FWAF+0Kn7qjWvFxM8HGu3tfT3tjKEXLMN0Kls+4AGnYH/zYl YrYtwv8dVcZEU1o/D78eqEWsAnzmA/x017lCYvFLcx6SUmIwEdOGbTT2RQp/ucs0/XQR Jp5P329ZmvybclMBMvZOwzziliySMaw9CdtW0Lh1L8wIoiHMfXg3YDzXx3+FnxVOOdoe s3DDokFSRSDE3mPFAbH0Gc20KCmPHkK/pXkoNfO3xiNKBRWslddt7NQKLBsQe7Ph42Dx 1Irw== 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=77D2+EVTj9+CfZEPusno4oI1bL04d6ygeYNHtNZmCXg=; b=cDesuyKA3Nl7p9NRJr24+yUenGLTzGmHKcRC+m7lVHggAFNQFXadNJQ8rsf9P178jU D67Hu+MEV9MCYpD+pLOfysVM81Vwtr8MaNBwoGax3D4vdsbVx5BR6XddFkOO9ah29F+U VYc0wjgvcLPR42yPIAx7ffOY5cYis6XLcnZB0MhGKpKlYyAT/6QeQtHePweayJYkAEDW dyBaY3O3XUqFNtk9Mhr0G+mDRTVQSbxLsd1MZN/esRR2ky1gRzX7sBK4gWd+JGadLGIv 723VDyLBQd81sx8lfjHtIV1h5K47MfPbHatTejojc5soyCWZP2mfD6crylTWG7mSPk/5 1tKg== 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 x16-v6si9608848pgf.311.2018.07.23.13.29.18; Mon, 23 Jul 2018 13:29:32 -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 S2388359AbeGWVas (ORCPT + 99 others); Mon, 23 Jul 2018 17:30:48 -0400 Received: from sauhun.de ([88.99.104.3]:51248 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388070AbeGWV3s (ORCPT ); Mon, 23 Jul 2018 17:29:48 -0400 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 25AE1631A4C; 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 , linux-kernel@vger.kernel.org Subject: [PATCH 03/12] i2c: mxs: use core to detect 'no zero length' quirk Date: Mon, 23 Jul 2018 22:26:07 +0200 Message-Id: <20180723202617.15230-4-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-mxs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 642c58946d8d..7d79317a1046 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -567,9 +567,6 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, dev_dbg(i2c->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; - /* * The MX28 I2C IP block can only do PIO READ for transfer of to up * 4 bytes of length. The write transfer is not limited as it can use @@ -683,6 +680,10 @@ static const struct i2c_algorithm mxs_i2c_algo = { .functionality = mxs_i2c_func, }; +static const struct i2c_adapter_quirks mxs_i2c_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN, +}; + static void mxs_i2c_derive_timing(struct mxs_i2c_dev *i2c, uint32_t speed) { /* The I2C block clock runs at 24MHz */ @@ -854,6 +855,7 @@ static int mxs_i2c_probe(struct platform_device *pdev) strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name)); adap->owner = THIS_MODULE; adap->algo = &mxs_i2c_algo; + adap->quirks = &mxs_i2c_quirks; adap->dev.parent = dev; adap->nr = pdev->id; adap->dev.of_node = pdev->dev.of_node; -- 2.11.0