From patchwork Wed Sep 5 19:37:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 146038 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp5341170ljw; Wed, 5 Sep 2018 12:38:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdavqgqFRlcXnCtZVK0pavbzZ79W6aoSSVvjUifRVUvIixKgCPwzAyvsqZ0yq9NEv/HfCZzq X-Received: by 2002:a63:e14a:: with SMTP id h10-v6mr37772534pgk.358.1536176332627; Wed, 05 Sep 2018 12:38:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176332; cv=none; d=google.com; s=arc-20160816; b=sKT/GfMpIJqTIjf+T/9E8cD8x+PB9mi0QFSVtc6HFkAW/ELEEDy94r7D1mGov9BFrw 0qns3x0Wr5W+7IjzsfkHkGdKWxIrShlwByFrxzFyQc1Wd56hDECV0pP91BI0ZPr3p02t FCydkorledonC+Cd5PTl1WP4BinKdmJGRk6Z4+GV6UDIb1eRHm9Tgtp8Ciw3KIp7daa9 ZXttP/s4hVvRStgLPf/L6D5wTSlb1OPHbyYRCwswLUVLTvvvvscdhFgnhepPMmvs9Xhc Uc9WPNbOF372+mhRxA3paaLFvHQjJG2foY8UYVtj+zVQWD0SSdqDl9UDfk84MIZTSovz ninw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=L6E6vVywGO46HqOghl5n+w7OMYLN/eyqP7WNYCEryGg=; b=Y+XXKMR9b6+Uctw2NSobG8j0OsVZ2m26Wb/Yv5R66k5oDNsyJ11kWPfEAuAdzTCOKG Ea5gwAJ2EYvYafR4N3xFe/U7Lry4G/ZP+brilpCCObsJGXlIJCHhR36tHGmQ34ehIbLr o5YvdU/E/lN8ZwsSslGUU+phOLoGEptIDs1FWKquXlfo6/2+TN6zbWsFXYE9L0CtJXI2 oHP66Be/nq/xO7Sx4xtSUZ3OoQMduxx7T1+O9krltfcBsk8CRhPGxzIEJ9Yos4xXGE9j YfvJktA6nykEfb0dKDTV/LjkJHlb4sDwJ82rqJ8pSbEkw3+2iJbqq2cINkZQoFsYGA+1 v43A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj4-v6si2603680plb.119.2018.09.05.12.38.47; Wed, 05 Sep 2018 12:38:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728318AbeIFAKW (ORCPT + 32 others); Wed, 5 Sep 2018 20:10:22 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:39654 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbeIFAJd (ORCPT ); Wed, 5 Sep 2018 20:09:33 -0400 Received: by mail-oi0-f67.google.com with SMTP id c190-v6so15917959oig.6; Wed, 05 Sep 2018 12:37:56 -0700 (PDT) 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; bh=L6E6vVywGO46HqOghl5n+w7OMYLN/eyqP7WNYCEryGg=; b=EtiCVm6YGav73ifd6rnm5MoR//WaykKyKC+O5/sLWVhguYTnoDLYhWOuM2H3AidYht CnwWhyLyI/WlDKrj3T0s8HLyfmxcFXHDlhSR1lvd0080oaSwKOKSOFrcJ9+WOlQmarQU vHGVsmw9xJeUDyROeQ7weOlEVu9AVgZ4hqY5vZqYpj6UOxJNz+26Svylyyf9Dmz5vnbc 3j1kQGSSzCXmBFI1QmnLSjVSdoR1KF5GNafNGNeyDYvvRQwkfDvsUsLX+rj1cytCGDkT CH2L4Ge2uzCJoniSj5cvdVXN32Rz9k8MnWbWqSPGKbjshoSUoIQ08sgv6s89tpWOqctf E4VA== X-Gm-Message-State: APzg51B984xSwVEUWB+0rKm/YGNlzaz4XJVkno+LMTgrsM9Mt28A7vxa AgozP4xPoe2NHV+9MlYGkQqvxq4= X-Received: by 2002:aca:3ad4:: with SMTP id h203-v6mr30022899oia.294.1536176275757; Wed, 05 Sep 2018 12:37:55 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id u21-v6sm2296053oie.22.2018.09.05.12.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 12:37:55 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Vitaly Bordug , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 13/21] powerpc: 8xx: get cpu node with of_get_cpu_node Date: Wed, 5 Sep 2018 14:37:30 -0500 Message-Id: <20180905193738.19325-14-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180905193738.19325-1-robh@kernel.org> References: <20180905193738.19325-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "device_type" use is deprecated for FDT though it has continued to be used for nodes like cpu nodes. Use of_get_cpu_node() instead which works using node names by default. This will allow the eventually removal of cpu device_type properties. Also, fix a leaked reference and add a missing of_node_put. Cc: Vitaly Bordug Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- Please ack and I will take via the DT tree. This is dependent on the first 2 patches. arch/powerpc/platforms/8xx/m8xx_setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index 027c42d8966c..f1c805c8adbc 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c @@ -66,7 +66,7 @@ static int __init get_freq(char *name, unsigned long *val) int found = 0; /* The cpu node should have timebase and clock frequency properties */ - cpu = of_find_node_by_type(NULL, "cpu"); + cpu = of_get_cpu_node(0, NULL); if (cpu) { fp = of_get_property(cpu, name, NULL); @@ -147,8 +147,9 @@ void __init mpc8xx_calibrate_decr(void) * we have to enable the timebase). The decrementer interrupt * is wired into the vector table, nothing to do here for that. */ - cpu = of_find_node_by_type(NULL, "cpu"); + cpu = of_get_cpu_node(0, NULL); virq= irq_of_parse_and_map(cpu, 0); + of_node_put(cpu); irq = virq_to_hw(virq); sys_tmr2 = immr_map(im_sit);