Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3275027rwl; Mon, 27 Mar 2023 11:35:54 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvqWEvz3Yw/asdJ7/F/yEMnfQhvZKUpEBbLhettcdiUZ2g2taNTJtRlzps8bk+HEcuf84T X-Received: by 2002:aa7:d0d4:0:b0:501:da04:b09b with SMTP id u20-20020aa7d0d4000000b00501da04b09bmr13695471edo.10.1679942154051; Mon, 27 Mar 2023 11:35:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679942154; cv=none; d=google.com; s=arc-20160816; b=B9vGJgSxpChrhrt0ROo+sxyEk0f/QgKvhadpf2/LzzbuAtTGDtD249LQ/V0ts72ZVJ eaNvLF7mzUJv1/WiNiC3fvrGnQi1b0RP2a1SBpwsYfUlok12RxwnAMh/o8J3VU6rxK+A g16l21Jw6ffwF8ywLuk8LZX6//RswmdSatvIOn3/fb9MijEXKoOaX2xeNky5p50LxG5P eOBTk7W7rO/s24bzxyUDsBln6kVOAIQ0K2q5ZjExgs/uHDJwCayVjmLtSgL5KLqShDUP rMcMwiQxI1jjS+3CnkUdA0JB9cI/hpWks7+uFOUn4+A76DGCPtFMZPIvOIlDps2vK6MJ wyRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=IQ7v2ex9dTmzCe2haOqOXoH6TENnIyNV9xel5tp8My8=; b=rb+0Pc012zLNLIxNizAyLuCrDdKqypHKpDfG0yrLfvFFEu5kOCIR1HV6n/EFt4WynH aiuTcPYooA7yW+SRKvml2HwKrdRfZ0HLeX+T7Adg9tDTrQCDcCBe5SM4wz2pY0Oz8j/d iIgb9L66RA07JuTzOY0tTCLnQgLjxrwT5npnfoBpgrh6/vNvtH7D8HNQOwRbeeTgphYM JOVG3Ey39eXykPWvu+TnyR25MFzywIGsSwJVW+biv8FwCKnsOdP06lLq/AV0jgbVwMVc jyg/Kog3Je84XQ0Pcxb2NklrMvlmaM+AQEKlHr3VbADWxY7B1/SaEN8BWPonxWqvGjb3 AR5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020aa7c24b000000b005021f0d576csi6381977edo.691.2023.03.27.11.35.29; Mon, 27 Mar 2023 11:35:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229598AbjC0S2d (ORCPT + 99 others); Mon, 27 Mar 2023 14:28:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjC0S2c (ORCPT ); Mon, 27 Mar 2023 14:28:32 -0400 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE791271D; Mon, 27 Mar 2023 11:28:26 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id bm2so7079983oib.4; Mon, 27 Mar 2023 11:28:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679941706; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IQ7v2ex9dTmzCe2haOqOXoH6TENnIyNV9xel5tp8My8=; b=JheVcrXGSM9asqfJTX/uZLNhJ83sy06on1UVEnUYpsgMD2FNtTK7un2iBwxkvlpNK3 ACHlgSo8u8MicDNTCmql4xrjJtcAVQCd3t1RIOrYFdj1IGLTCPadT7uMer95xLB6qKKM Yen23l1zwXFcBnOReAFd93YBgqgryINgVK7bRafd/8IElJ3ReXJsZ7ykHwaSCP1mqzp8 RRrZN/MK19bKL2n5k3ugbMtE8cDeqDd7v101xXH5UPCpM5ZXD6jo5LMaEkWJlN5jUS/Q HMzkimv8diVej8CsRBMfZjfEqzaIuPt36s0qmE43lg63EahbMIEIIYQshT6z+88SqmbJ VFUg== X-Gm-Message-State: AO0yUKXgtMi/P28LlyVAAsLCGUIOtiRembErlgNpDPappW6Cl2e4HWX3 hTedH7EtErtWDZH/VK2maA== X-Received: by 2002:aca:1b09:0:b0:383:eff6:d3c3 with SMTP id b9-20020aca1b09000000b00383eff6d3c3mr5659291oib.3.1679941706033; Mon, 27 Mar 2023 11:28:26 -0700 (PDT) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id 124-20020a4a0082000000b0053732f1acd2sm1559427ooh.5.2023.03.27.11.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 11:28:25 -0700 (PDT) Received: (nullmailer pid 234000 invoked by uid 1000); Mon, 27 Mar 2023 18:28:25 -0000 From: Rob Herring To: Jonas Bonn , Stefan Kristiansson , Stafford Horne Cc: linux-openrisc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] openrisc: Use common of_get_cpu_node() instead of open-coding Date: Mon, 27 Mar 2023 13:28:16 -0500 Message-Id: <20230327182816.233818-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.8 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The common of_get_cpu_node() is equivalent to setup_find_cpu_node(), so use it instead. Signed-off-by: Rob Herring --- arch/openrisc/kernel/setup.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 0cd04d936a7a..9cf7fb60441f 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -152,21 +152,6 @@ static void print_cpuinfo(void) printk(KERN_INFO "-- custom unit(s)\n"); } -static struct device_node *setup_find_cpu_node(int cpu) -{ - u32 hwid; - struct device_node *cpun; - - for_each_of_cpu_node(cpun) { - if (of_property_read_u32(cpun, "reg", &hwid)) - continue; - if (hwid == cpu) - return cpun; - } - - return NULL; -} - void __init setup_cpuinfo(void) { struct device_node *cpu; @@ -175,7 +160,7 @@ void __init setup_cpuinfo(void) int cpu_id = smp_processor_id(); struct cpuinfo_or1k *cpuinfo = &cpuinfo_or1k[cpu_id]; - cpu = setup_find_cpu_node(cpu_id); + cpu = of_get_cpu_node(cpu_id, NULL); if (!cpu) panic("Couldn't find CPU%d in device tree...\n", cpu_id); @@ -255,7 +240,7 @@ static inline unsigned long extract_value(unsigned long reg, unsigned long mask) void calibrate_delay(void) { const int *val; - struct device_node *cpu = setup_find_cpu_node(smp_processor_id()); + struct device_node *cpu = of_get_cpu_node(smp_processor_id(), NULL); val = of_get_property(cpu, "clock-frequency", NULL); if (!val) -- 2.39.2