From patchwork Sat May 8 22:00:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1475931 X-Patchwork-Delegate: trini@ti.com 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; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Of+tcCll; 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 4Fd1Xx2QVvz9tlZ for ; Sun, 9 May 2021 08:03:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3B1AF82ED5; Sun, 9 May 2021 00:02:02 +0200 (CEST) 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="Of+tcCll"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D806282E92; Sun, 9 May 2021 00:01:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (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 CA9BB82EA2 for ; Sun, 9 May 2021 00:00:41 +0200 (CEST) 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-io1-xd31.google.com with SMTP id z24so11325066ioj.7 for ; Sat, 08 May 2021 15:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fncw/1jrY1Ur9elRaq+QliyAbWR3VJw9mhzDsj/W1D0=; b=Of+tcClloQYiToisILloBIGXZUaD552wwdplKQ/GaamMDK/2xE/fSwmxUrj9qnqJYj G8oog0+4CYsPWCrsgeGUUr39fmAtM3jsp/H5qILvQEnjVqAcOntBceoGVJpumlXl6jw5 tfztEG9a5HROFBEiQ+0eEoc0uN63u54yUShvQ= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fncw/1jrY1Ur9elRaq+QliyAbWR3VJw9mhzDsj/W1D0=; b=BTuQggufFYnKbCZV3KGHzllUMl6Z7t9W/GEHekS57l3pu2CVk9d0u2t7jVy9nFHc3R 2VZVKCV947PjGGThm3bMqBGF3NQPbO+KLkZ3cQ7bxPlXTIviG/SJJV+CHmjgkTA2191I cCbtwN7WTHaY6wHxBziBfKtU59LSi9hBiFILAdPMUFbh9o++EPfmt3Tr0W5ILL28UnRo Qp4dWwpoBKtj+jjrEtDoNHlQXvCB/HzZq0vuo7P9iDM491/PDbEqpDuqnsujSKccDbou VDFAagZOiDU5Jr5ELaoet29Ub8P4+F2Z+pQ3U2n8RJ9uO7yrLd8p3d6AC9wGCShp54yF tK+g== X-Gm-Message-State: AOAM532AGpi6vMRcsT7Qr021o+w0mTL+2zmSPwOLvT0MK19+Mh7Ask8c MuKogswtyhF81Xsq47MCYnSf9ZFBX2l3hz2A X-Google-Smtp-Source: ABdhPJyr6EWnWshJ8LcFly+gAPKcfIzN+GdwhKo+ZlTGIC5G/moamlt62B0vXKV5MVrRxrir18B3rg== X-Received: by 2002:a02:c9c8:: with SMTP id c8mr14788681jap.71.1620511240025; Sat, 08 May 2021 15:00:40 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t7sm5195196ile.87.2021.05.08.15.00.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 15:00:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Lukasz Majewski Subject: [PATCH 16/17] clk: Detect failure to set defaults Date: Sat, 8 May 2021 16:00:20 -0600 Message-Id: <20210508220021.1778080-17-sjg@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210508220021.1778080-1-sjg@chromium.org> References: <20210508220021.1778080-1-sjg@chromium.org> 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.4 at phobos.denx.de X-Virus-Status: Clean When the default clocks cannot be set, the clock is silently probed and the error is ignored. This is incorrect, since having the clocks at the correct speed may be important for operation of the system. Fix it by checking the return code. Signed-off-by: Simon Glass Reviewed-by: Sean Anderson --- drivers/clk/clk-uclass.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c index 4ab3c402ed8..2a2e1cfbd61 100644 --- a/drivers/clk/clk-uclass.c +++ b/drivers/clk/clk-uclass.c @@ -796,13 +796,17 @@ void devm_clk_put(struct udevice *dev, struct clk *clk) int clk_uclass_post_probe(struct udevice *dev) { + int ret; + /* * when a clock provider is probed. Call clk_set_defaults() * also after the device is probed. This takes care of cases * where the DT is used to setup default parents and rates * using assigned-clocks */ - clk_set_defaults(dev, 1); + ret = clk_set_defaults(dev, 1); + if (ret) + return log_ret(ret); return 0; }