Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6207078imm; Mon, 23 Jul 2018 13:29:38 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeO7wuOuSqUx8jxrv7IpVcN98O/iF+OS9NwJROXLC4Ijs1TlS0dr6zEwg7W6p87YyKAlFeR X-Received: by 2002:a17:902:5501:: with SMTP id f1-v6mr14274171pli.219.1532377778315; Mon, 23 Jul 2018 13:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532377778; cv=none; d=google.com; s=arc-20160816; b=hZXKv2AzTN9CJ6mGmpTXzJe9O2TuKRk2GZU4KGMTXHWo6yrxmOOBEBeW8Mwamr6+4w 8f3Zyd6DG5uL2e2n/YtnShCeQNtjJ5wi3zDFN4H6n/zmtG2NWOGCHgc9gtFu7aDuZjO+ tCEsq21D4hBkO161aS224lQaGQsck7jgunWjCWxqKVzVHL4Rh41+41tQ3XF0VI06jWqm G0z/0R3nmkLZ/rlVc90UIk8OjrCkhE1VOgWUsS5WPzce1kdrRXpLJ2ZSelSbBD8Zg6C1 lZRC+9FSgsfWlzLi/9m7Eop1d6sH0rzQ7qlfyrHkYSIDAnnVWyXVzRwDl2BSRaqsR7Bq Nnkw== 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=Vxfv3KaQloB0kBX7xnUwjWAyZDsOWmhcEgegS3gmA08=; b=qEanriL6C5WRRt7gFJt1uAcjzh2+b1tvSuNnQOO1FuUBO7Ur2wfRY47XYkobwb4nN2 dufy9EhRefsJkBzh3+yOLKs8tF/lIxVrkf5UfRX3bvQ1RQBSWU2Cezz/aTm/ZeKXQn+w fwmNBDbsLq+LehfTcw5GUSTEwtQMjYzfHYLD/snazgwC/L9fo4iXbTKMfV7LB3GW1h2l Nk9bldsBYzMawK0Ty9i6ENOLK4K5vZ7pLUO62y4F6tBzGlssXBxXIvZSAWCmjE2pM9Ig +9nEQXREzq+8vJVN+XRVWvy02mz7XLbXFY6oSFXLGKyKOgYrkTBP9+t89tMaDoXN7SIi d8aw== 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 s24-v6si9436873plq.358.2018.07.23.13.29.23; Mon, 23 Jul 2018 13:29:38 -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 S2388172AbeGWV3s (ORCPT + 99 others); Mon, 23 Jul 2018 17:29:48 -0400 Received: from sauhun.de ([88.99.104.3]:51238 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388064AbeGWV3r (ORCPT ); Mon, 23 Jul 2018 17:29:47 -0400 Received: from localhost (p54B3377D.dip0.t-ipconnect.de [84.179.55.125]) by pokefinder.org (Postfix) with ESMTPSA id 7620A631A4B; Mon, 23 Jul 2018 22:26:53 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Wolfram Sang , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-kernel@vger.kernel.org Subject: [PATCH 02/12] i2c: designware-master: use core to detect 'no zero length' quirk Date: Mon, 23 Jul 2018 22:26:06 +0200 Message-Id: <20180723202617.15230-3-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-designware-master.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index fc7c255c80af..a1717bff06a8 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -274,13 +274,6 @@ i2c_dw_xfer_msg(struct dw_i2c_dev *dev) break; } - if (msgs[dev->msg_write_idx].len == 0) { - dev_err(dev->dev, - "%s: invalid message length\n", __func__); - dev->msg_err = -EINVAL; - break; - } - if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) { /* new i2c_msg */ buf = msgs[dev->msg_write_idx].buf; @@ -523,6 +516,10 @@ static const struct i2c_algorithm i2c_dw_algo = { .functionality = i2c_dw_func, }; +static const struct i2c_adapter_quirks i2c_dw_quirks = { + .flags = I2C_AQ_NO_ZERO_LEN, +}; + static u32 i2c_dw_read_clear_intrbits(struct dw_i2c_dev *dev) { u32 stat; @@ -718,6 +715,7 @@ int i2c_dw_probe(struct dw_i2c_dev *dev) "Synopsys DesignWare I2C adapter"); adap->retries = 3; adap->algo = &i2c_dw_algo; + adap->quirks = &i2c_dw_quirks; adap->dev.parent = dev->dev; i2c_set_adapdata(adap, dev); -- 2.11.0