Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp619imm; Wed, 5 Sep 2018 12:40:32 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaOE1HDFNU8NG0PvUgrRDEJP2vIU7Gx9K3bhhvijCRRMNqnJYwI1a3iH1uL1lB2+xBjUIWo X-Received: by 2002:a17:902:5381:: with SMTP id c1-v6mr14092129pli.296.1536176432857; Wed, 05 Sep 2018 12:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536176432; cv=none; d=google.com; s=arc-20160816; b=C03YU5xaBWQ4EWhPzZAxbUoOGOK88Ka/0GQIGaMtYN8bFLbhRybCkusfvdUh4jTzoY sB+rMn4xwM7NQOEJ4oXcy9JXhMgPXUnH9W+8V1liNQC2YH1tMNPeuyC2SWwjJkSZMwDf yoeJd+c6LK8hlLh6dh60oMPg/crN59hYyRWToCEoDHKFBrZ1wo7vEHEdOcD8DKNWTMCW QoIPz+qaGrdZ3aLDoceOwUPnXmxeG2NvcR1ivxfIqolGyXHnFJRCR3C4XAey8cTr8fPk cWMlMF3dXgRiEFVj9MAXae2OWkCjgTDzuwyC7ujYRVlR7xLXZW5GJ+4MgURw3e6Oczky /CmQ== 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 a91-v6si1164374pla.123.2018.09.05.12.40.17; Wed, 05 Sep 2018 12:40:32 -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 S1728315AbeIFAKW (ORCPT + 99 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(-) 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); -- 2.17.1