Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp403768ybg; Thu, 19 Mar 2020 01:51:01 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLqrNdhuT9/L2MFvKwwUmT4IdR549H42ShoYJVKGrswzwjqKn2uoJOLhslNkqVNNXsmmDM X-Received: by 2002:a05:6830:150f:: with SMTP id k15mr1298919otp.251.1584607861249; Thu, 19 Mar 2020 01:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584607861; cv=none; d=google.com; s=arc-20160816; b=iXl59Pg+p2jLCORE/6pIcUo/EqorpkUeBs4ohZJbleKXq8gyGENpx6g/R9jWDAjHSn Qg6wo5fno4sDjuHVgUibSM0/+3w36W9KuDP7YPbXo7NAwdAtmqqz8df6kNfAsOGVv0sT ZyJNV4CPQDO5zV1yXcaNRfxKaumb89HcmpXd7g+Q1fDnw+wyleUzQYrVge3jaDRHZjAv L5v+o51z0FX6KPAymWP7ht/qWCDHQ7zo4hqhjoIgKXmcLOXrtUAWLAmP9GgnuQaSwi11 nx5NpEnFfiZagCuyO6A/YCY7NpcvxU9lXcSO17xBzZLAOCr391RAzYSjjwxkTkPafSTD +O3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=t6xG63M2J4kwUPG1T8pzwfdDX71OfLb9gGCTSWWBpVA=; b=U1virbvuKjbGTH+16mJPVO+ISeye6l5j69H6TAu2oCx4HQAFi0aWMWUV2Cd/tkYaCR isxQPFWIhhJonROyGZ2WB5/oaGSgmGBDPSFptBC3u+L+qcF2PcIqpIEl7Nwd8Vx3UNoq 5wYofFS2rwscNLjyBBtMKY9Sc4fpZlN5C9+GwLPC9QFrwNjptq7C8e2pCRqPE+AmtTAq aqlR05ve0hRU50pjAjpXbrDfUI9e91c3SUMfNS3fDMf0U8PPuk1ew6yijMwNx4wpa/mD RCeUNnjskFejM3LG1wXZoHMEUeEBkwB6J8QzRY3QVNdV2Y4SJMaieo1q8kO/r/zbFuAw Egdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si973267otq.226.2020.03.19.01.50.49; Thu, 19 Mar 2020 01:51:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726911AbgCSIrx (ORCPT + 99 others); Thu, 19 Mar 2020 04:47:53 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:59687 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbgCSIrw (ORCPT ); Thu, 19 Mar 2020 04:47:52 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jEqqC-0002xG-5J; Thu, 19 Mar 2020 09:47:48 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id A07521C2297; Thu, 19 Mar 2020 09:47:46 +0100 (CET) Date: Thu, 19 Mar 2020 08:47:46 -0000 From: "tip-bot2 for Saravana Kannan" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] clocksource/drivers/timer-probe: Avoid creating dead devices Cc: Saravana Kannan , Daniel Lezcano , x86 , LKML In-Reply-To: <20200111052125.238212-1-saravanak@google.com> References: <20200111052125.238212-1-saravanak@google.com> MIME-Version: 1.0 Message-ID: <158460766637.28353.11325960928759668587.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the timers/core branch of tip: Commit-ID: 4f41fe386a94639cd9a1831298d4f85db5662f1e Gitweb: https://git.kernel.org/tip/4f41fe386a94639cd9a1831298d4f85db5662f1e Author: Saravana Kannan AuthorDate: Fri, 10 Jan 2020 21:21:25 -08:00 Committer: Daniel Lezcano CommitterDate: Tue, 17 Mar 2020 13:10:07 +01:00 clocksource/drivers/timer-probe: Avoid creating dead devices Timer initialization is done during early boot way before the driver core starts processing devices and drivers. Timers initialized during this early boot period don't really need or use a struct device. However, for timers represented as device tree nodes, the struct devices are still created and sit around unused and wasting memory. This change avoid this by marking the device tree nodes as "populated" if the corresponding timer is successfully initialized. Signed-off-by: Saravana Kannan Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20200111052125.238212-1-saravanak@google.com --- drivers/clocksource/timer-probe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clocksource/timer-probe.c b/drivers/clocksource/timer-probe.c index ee9574d..a10f28d 100644 --- a/drivers/clocksource/timer-probe.c +++ b/drivers/clocksource/timer-probe.c @@ -27,8 +27,10 @@ void __init timer_probe(void) init_func_ret = match->data; + of_node_set_flag(np, OF_POPULATED); ret = init_func_ret(np); if (ret) { + of_node_clear_flag(np, OF_POPULATED); if (ret != -EPROBE_DEFER) pr_err("Failed to initialize '%pOF': %d\n", np, ret);