Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6660FC433F5 for ; Wed, 29 Dec 2021 18:50:47 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10E1E830C3; Wed, 29 Dec 2021 19:50:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IAlGzgsa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 22B5E811BA; Wed, 29 Dec 2021 17:59:08 +0100 (CET) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (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 5A8B782FAF for ; Wed, 29 Dec 2021 17:59:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jbx6244@gmail.com Received: by mail-ed1-x52f.google.com with SMTP id y22so88573524edq.2 for ; Wed, 29 Dec 2021 08:59:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AJurI531mAmyGFGAiqS9jn7EyOoYy2NxKfjuGEq5PPo=; b=IAlGzgsaEUotOLIK52so4zOekgDxQNCFWu08ngPbGjdJQgVyo3MUAMXfT9S8C0k1vK AMOad2WWijuCqnhtoIYh1lRRDub+RhxDAXrnvjX0hDWC2uAeYf/UNUf4QddxB9lxNpEU NHHo68xykEdBI4Pmx5r1AiB1B8pufWPylEZi+UiUn6aEcNWzVfRdh0n48NXmoMQPt3u0 qsRAbuDBNfHpXR9VSNs39nCJWQ4AfaquO3+qxaz7ethhDaqpvS9JPaQx89+uPaHCGw+T t4OYezK0+kXsRW3D3aI+KtGc6API95URGTQfwnvGofWui+MxKI9Ln6gWy5C21Oep6mtv NtwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AJurI531mAmyGFGAiqS9jn7EyOoYy2NxKfjuGEq5PPo=; b=BzMCVXpfPU03KA8FN6yMFcMGSOtWY87SAzZr81v1w8Sl3SYroQzk0mHaydooXk237C xjewaqWX87fcNW8H8cODBpKtZ1KEDJnrA7GISLhh+SBY789Fct6O28/35CEK3CWWCHyE U16Pn3NKmIv1O5mW/Za4NnC6LmDb0CzCYbrERuySjBjX2xrFXRsdwCgSxnJzUH5e6e6i tp2q25KPfJLBno8p10Vo+cMwU3g3CLFa7hZrVQOkkiubpO6haeX2mXQZBo6v813n+NMN 81/Omu7AcRcdORo//sCr5/e7CYLhSEmS75SfBPp5YoGU00RqPwEwXCdd1vgwyj1wcMCs +qhQ== X-Gm-Message-State: AOAM533zj6V5Ui5KZRRzl5l6T1/FE5is7eB6ks0HTh6zyKavFMStkRqK mDV0K8iEi60o54nnMkM7jI4= X-Google-Smtp-Source: ABdhPJzdqTFZgJuxAOD9gtzIArgoImiTTKgSNJJlMb9rxigrwFZ0QQesQUt8X2NUFOx74zMXJ0Mf5g== X-Received: by 2002:a17:906:b151:: with SMTP id bt17mr22081714ejb.193.1640797141058; Wed, 29 Dec 2021 08:59:01 -0800 (PST) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id g19sm8695051edr.6.2021.12.29.08.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 08:59:00 -0800 (PST) From: Johan Jonker To: kever.yang@rock-chips.com Cc: sjg@chromium.org, philipp.tomsich@vrull.eu, u-boot@lists.denx.de Subject: [PATCH v2 4/4] rockchip: tpl: use IS_ENABLED for timer_init() call condition Date: Wed, 29 Dec 2021 17:58:50 +0100 Message-Id: <20211229165850.6911-4-jbx6244@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211229165850.6911-1-jbx6244@gmail.com> References: <20211229165850.6911-1-jbx6244@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Wed, 29 Dec 2021 19:50:14 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.103.2 at phobos.denx.de X-Virus-Status: Clean Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available. Use the call condition IS_ENABLED to increase build coverage and make the code easier to read. Signed-off-by: Johan Jonker --- arch/arm/mach-rockchip/tpl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c index 5ce6e57c..2729264b 100644 --- a/arch/arm/mach-rockchip/tpl.c +++ b/arch/arm/mach-rockchip/tpl.c @@ -80,8 +80,9 @@ void board_init_f(ulong dummy) if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER_BASE)) rockchip_stimer_init(); - /* Init ARM arch timer in arch/arm/cpu/ */ - timer_init(); + /* Init ARM arch timer */ + if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER)) + timer_init(); ret = uclass_get_device(UCLASS_RAM, 0, &dev); if (ret) { -- 2.20.1