From patchwork Fri Apr 14 20:53:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 9681781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E8F0460386 for ; Fri, 14 Apr 2017 20:53:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D97AC285A9 for ; Fri, 14 Apr 2017 20:53:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CDBAC286A9; Fri, 14 Apr 2017 20:53:48 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 6C1F0285A9 for ; Fri, 14 Apr 2017 20:53:48 +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: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:In-Reply-To: References:List-Owner; bh=seroXx+rtwngyaaoYf827KEoGrj+vIGVZeOjClzj/Ps=; b=IIA W9waQwRWOxUDA1zMW1eeBKv+G3B8Eb5/6XKkaw74inxQTJDorW3vMhh/7pNGu8Dns42gWMzz+KALY LPEA+zpCw7DGsIFCOF704pUvL2qHe5k69spXPoH6ZA27EdUkBHmW9Qeif17TzzWpuWr9S+SbnXBRS cbVYR9/MXnDSpDCiOvI9vrQrL2Kqr4LBVqEoEeX7il7zJBhKvEGhxR40RWztCLR/NIZOQ7n0iuiVC QmXnR+aFetSvejGfd19yMDnbEY49IMRj3R58WELP9CWaQW5ptwAFTjeirbEwU6qS2UC5dJbPPbGn/ wl0Kdsy4+IzcQSZZtSREn+EnMm1ZgzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cz8Dz-00077C-PD; Fri, 14 Apr 2017 20:53:47 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cz8Dw-00074u-SN for linux-arm-kernel@lists.infradead.org; Fri, 14 Apr 2017 20:53:46 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id 78F7A20864; Fri, 14 Apr 2017 22:53:23 +0200 (CEST) Received: from localhost (132.230.147.77.rev.sfr.net [77.147.230.132]) by mail.free-electrons.com (Postfix) with ESMTPSA id 2396220839; Fri, 14 Apr 2017 22:53:23 +0200 (CEST) From: Thomas Petazzoni To: Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Wolfram Sang Subject: [PATCH] i2c: designware: do not show SDA hold time warning when not needed Date: Fri, 14 Apr 2017 22:53:12 +0200 Message-Id: <1492203192-28025-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170414_135345_062217_0810B2FB X-CRM114-Status: GOOD ( 11.69 ) 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: Thomas Petazzoni , linux-i2c@vger.kernel.org, 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 When the I2C controller IP block has a revision too old to be able to configure the SDA hold time, the driver currently displays a warning. However, it does so unconditionally, even if no SDA hold time has been configured through the Device Tree. This causes useless warnings when running the system, so only show the warning if a SDA hold time was specified. Signed-off-by: Thomas Petazzoni Acked-by: Jarkko Nikula --- drivers/i2c/busses/i2c-designware-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index 7a3faa5..7f9da6e 100644 --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c @@ -436,8 +436,9 @@ int i2c_dw_init(struct dw_i2c_dev *dev) dev->sda_hold_time |= 1 << DW_IC_SDA_HOLD_RX_SHIFT; dw_writel(dev, dev->sda_hold_time, DW_IC_SDA_HOLD); } else { - dev_warn(dev->dev, - "Hardware too old to adjust SDA hold time.\n"); + if (dev->sda_hold_time) + dev_warn(dev->dev, + "Hardware too old to adjust SDA hold time.\n"); } /* Configure Tx/Rx FIFO threshold levels */