From nobody Thu Dec 18 05:21:18 2025 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9A80257432; Mon, 12 May 2025 08:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747037337; cv=none; b=BiSfm9w5St33sAhKCxaL6GHUzuXP7Lx4B2Q0yjuFpZAVqKuS6NgenhUH5g81QsQquUW/NS3DN0KlQBoLBk/qADGatzSDSztG7DXoLMkMzIywyKWEenfFERby2od1Z0aUL/4fOhegOGFAOVj1jC59duGzMqkHzER+Gj2mhJabIhM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747037337; c=relaxed/simple; bh=H+X+r317beI8ScvSsUNB9Kq/c/yryvAfMBuE5VgT33Y=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MpKDYJCI/mPeQZJDcmqxBYBUAOywkM2IrtwUPzHXHJefR90d3klhUo4Pt1zlIj+ZezS74IeD9tKuAB/mokRIBrQDla4Jh7uRNBED9wQp4D/7ULgwYl6aw/YSryciq6zy+rXvwoEnXpsXkHBOHtLyX7yntgcq0nFRjFI98p/0Ro4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4ZwsZR13dnz6M4hn; Mon, 12 May 2025 16:04:15 +0800 (CST) Received: from frapeml500003.china.huawei.com (unknown [7.182.85.28]) by mail.maildlp.com (Postfix) with ESMTPS id B7CD614050C; Mon, 12 May 2025 16:08:53 +0800 (CST) Received: from a2303103017.china.huawei.com (10.47.30.10) by frapeml500003.china.huawei.com (7.182.85.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Mon, 12 May 2025 10:08:52 +0200 From: Alireza Sanaee To: CC: , , , , , , , , , , , , , , , , , , Subject: [PATCH v3 3/7] coresight: cti: Use of_cpu_phandle_to_id for grabbing CPU id Date: Mon, 12 May 2025 09:07:11 +0100 Message-ID: <20250512080715.82-4-alireza.sanaee@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250512080715.82-1-alireza.sanaee@huawei.com> References: <20250512080715.82-1-alireza.sanaee@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) To frapeml500003.china.huawei.com (7.182.85.28) Content-Type: text/plain; charset="utf-8" Use the newly created API to grab CPU id. Signed-off-by: Alireza Sanaee --- .../hwtracing/coresight/coresight-cti-platform.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-cti-platform.c b/drivers= /hwtracing/coresight/coresight-cti-platform.c index d0ae10bf6128..cd821e926792 100644 --- a/drivers/hwtracing/coresight/coresight-cti-platform.c +++ b/drivers/hwtracing/coresight/coresight-cti-platform.c @@ -41,21 +41,12 @@ */ static int of_cti_get_cpu_at_node(const struct device_node *node) { + struct device_node *dn =3D NULL; int cpu; - struct device_node *dn; =20 - if (node =3D=3D NULL) - return -1; - - dn =3D of_parse_phandle(node, "cpu", 0); - /* CTI affinity defaults to no cpu */ - if (!dn) - return -1; - cpu =3D of_cpu_node_to_id(dn); + cpu =3D of_cpu_phandle_to_id(node, &dn, 0); of_node_put(dn); - - /* No Affinity if no cpu nodes are found */ - return (cpu < 0) ? -1 : cpu; + return cpu; } =20 #else --=20 2.34.1