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: 750953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3w4VHW2fZgz9s7p for ; Sat, 15 Apr 2017 06:53:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751462AbdDNUxZ (ORCPT ); Fri, 14 Apr 2017 16:53:25 -0400 Received: from mail.free-electrons.com ([62.4.15.54]:54773 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751369AbdDNUxZ (ORCPT ); Fri, 14 Apr 2017 16:53:25 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 78F7A20864; Fri, 14 Apr 2017 22:53:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 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 Cc: linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thomas Petazzoni 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 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org 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 */