From patchwork Mon Nov 9 14:12:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1396795 X-Patchwork-Delegate: hs@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ISNxacs6; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CVCdV1Kvfz9sRK for ; Tue, 10 Nov 2020 01:13:17 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E144A82515; Mon, 9 Nov 2020 15:12:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ISNxacs6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DA33182538; Mon, 9 Nov 2020 15:12:57 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9326F8250F for ; Mon, 9 Nov 2020 15:12:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x141.google.com with SMTP id x7so8400179ili.5 for ; Mon, 09 Nov 2020 06:12:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EuMwMCIh15e/mgsgWxlI9T39YQjjHiysd8FwcdtIexY=; b=ISNxacs6JIaw6cZFsOYQp600dtwhqh+rHYjBsz7tbjPudJbBeL9J8KYmBnI7AL1VO1 NfXSHm4fk2/2VYEISsKSBS4nj92NZX88yGpGf6fEeGN7e/sYM2X+G1HbSMVmqp1UfqHn iELcbX0+R7qK3v7Y45l4Iq4ctzlqxS5K3jD0g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EuMwMCIh15e/mgsgWxlI9T39YQjjHiysd8FwcdtIexY=; b=Xvn5w8nI6d0wdsfy+EOfnqivhAiBdY8l76bzQEIQFlwHaAINzHsK0+cbeOZEQtWXPP T23nMu1tNSeNByn6mY8DBLXR0xqI8ChtQEmtRpwcC+8h5ZxkAMTbZw70hg9dY8mnPS/+ c1o/W4KYJTMVQtsZIII9KxgROAuuT8eI7LsJOgiCZjiCVJu0tDu3WMgNELs60Zci44FI FH2E535KVUxcCCG2cd7y6XesIXJIY4ivuzdsX7cWxUbKJjHBSh42r2sZaGgrUtmvQFhC nPU4mzzW8VjJF50NdtwLJN7GU2jNpUx71DQn6JKJzidmoycVoYjJjVbS19/egymcwmhP grwQ== X-Gm-Message-State: AOAM533Js8EBd5iqHzku2AA6PkoPhYlWB2HE+LMwN24Of6izH99QONz1 aWr7T9mrAtRJk//0SI/KTLGtKtUOK9Exkw== X-Google-Smtp-Source: ABdhPJwpS85UpSfv/vKIwDn/EO8TMHfIcAykloV24cBTjCc02sV8jPHypKRQk1kmYHf1sezKqlt2Sg== X-Received: by 2002:a92:da83:: with SMTP id u3mr10093488iln.75.1604931172312; Mon, 09 Nov 2020 06:12:52 -0800 (PST) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id c80sm7567223ill.20.2020.11.09.06.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Nov 2020 06:12:51 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Heiko Schocher Subject: [PATCH] i2c: designware_i2c: Don't warn if no reset controller Date: Mon, 9 Nov 2020 07:12:49 -0700 Message-Id: <20201109071244.1.Ie56bb458564739b03616a24da322b72c6fc2250b@changeid> X-Mailer: git-send-email 2.29.2.222.g5d2a92d10f8-goog MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean At present if CONFIG_RESET is not enabled, this code shows a warning: designware_i2c_ofdata_to_platdata() i2c_designware_pci i2c2@16,0: Can't get reset: -524 Avoid this by checking if reset is supported, first. Fixes: 622597dee4f ("i2c: designware: add reset ctrl to driver") Signed-off-by: Simon Glass --- drivers/i2c/designware_i2c.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/designware_i2c.c b/drivers/i2c/designware_i2c.c index 791f32e971c..c54989504ea 100644 --- a/drivers/i2c/designware_i2c.c +++ b/drivers/i2c/designware_i2c.c @@ -774,10 +774,12 @@ int designware_i2c_ofdata_to_platdata(struct udevice *bus) dev_read_u32(bus, "i2c-sda-hold-time-ns", &priv->sda_hold_time_ns); ret = reset_get_bulk(bus, &priv->resets); - if (ret) - dev_warn(bus, "Can't get reset: %d\n", ret); - else + if (ret) { + if (ret != -ENOTSUPP) + dev_warn(bus, "Can't get reset: %d\n", ret); + } else { reset_deassert_bulk(&priv->resets); + } #if CONFIG_IS_ENABLED(CLK) ret = clk_get_by_index(bus, 0, &priv->clk);