Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1459378lqa; Mon, 29 Apr 2024 09:02:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIglCZAW+awyw2rJONhgQ7g89SXioT/YMKYOU7NzpIUlrDWdAU6smtxD93kXtrrHAYOxD/WbQhULdpDMzDiAwpYUrXJxSNQQMYH3xRHw== X-Google-Smtp-Source: AGHT+IHyjzV/YRodLZ/tg61nm1GB6v119VeaVmCpsbVLTHDEPItofQABMcNq5kuRmfDdF2/+9FK6 X-Received: by 2002:a05:6a21:2d09:b0:1a8:4e82:b1e5 with SMTP id tw9-20020a056a212d0900b001a84e82b1e5mr13586910pzb.32.1714406537754; Mon, 29 Apr 2024 09:02:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714406537; cv=pass; d=google.com; s=arc-20160816; b=QnZj5d80XwmghRzZetaU/5hellR0Cc21+vvfwsGSwX5nQoEYreN4HUcj5sG+hdBbdw G97LPxJnC7yLbxp5c8UI+Oev8Wji1AyvDDc066k/c4UpuxPC5WWkTd7tcb7FEBklyy52 wWDQyBS5c/igK1MTW67Sig8BoxIv4dfGe9/dX0ffqmlrcC4ht8e4qNGSe5cpZr9nyzOJ YOKJOtMj60g1pFtugXoSAU+hxdCORjQa+zdfbn8hdktYif9h6tyowa4do8ApAcIOEWLc jevYgmd4gdUdA4t/tXmlvJUIW+rQ8NuVtl4IiJfhuCRUVobjo00/w3MhGglSNTrZBqYu mZQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2jdSQ0/aqySQxy913Sm00zmMjGWDvOJJxzhOJu4+6ec=; fh=gJB9ah+6pioo+a5X72WRi1TwljDLuxU9XuaZO7ekO6c=; b=VafxAb18NOKzJtSNMkSgJ+AaYvEUlAys9WVNJN69SCJ3Ja/ns3THKVyoRv1SMp7LdE 4jzE34HJTTIv/iZepIn2HgBrWFRS3d88rQ/tabkU2GeclpKdMEAY8lv35PP9Qcx78LYQ alEy+UjqYKMYNcjRDNudFUNL2vzKTMBwGbzhaUtVXdCZEV8JoNnebXAAbYU6+GTpPWIR 1MLewpCG64tyqJDHT1WD8ExREzFv9PJQtIUuz3MhCdLjQZOh9F4tEDrDzAd+/liJxAKI LlcGU3M+DGheDbl+xVSBr2sZkUDLCLGEvYnw/bDg4xPjS1fYHQ7KOIOobB0MRlz3IKd3 n8/g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FqIGvbXk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162638-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id lo5-20020a056a003d0500b006eac9744617si14915819pfb.127.2024.04.29.09.02.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 09:02:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FqIGvbXk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162638-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E6E90283647 for ; Mon, 29 Apr 2024 16:00:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E77BC839F1; Mon, 29 Apr 2024 15:59:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FqIGvbXk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 17ECB82871; Mon, 29 Apr 2024 15:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406395; cv=none; b=odrKwJU9YHLKR9V01sqMnenqXeftfltOs0ypXE90Wc2I9Vsn9bO3AFAzZJoruo/1wrHXYIv3ZHYz7A+aarL3+EC000UJnAWzZAh4at/UFZv4En1ecrJrS7R5vk7WRBiws57GRN/6HtzpARVr6SbwTchlcGRlGjFItbEd14iIMpU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714406395; c=relaxed/simple; bh=CfhM0Hi7F1bxXQjfyx4hYuRdzA5vtBwb494TLMOky9s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q+o7gNVrSxv9bfiHQEvZD1rw6Ic9boz+bP98GmxJyPAS5e28wyhF5Ia8HnPyJbw9PTviX+cbFum2dHav1HVRZU1wKTzYIJ4GP9RjnEyEl8+RJScXmMcT4JYyqPOv+ijIBC3F8IYvcBxUn4ODSjeMHLkjQyX1u7huBPLk1auXNho= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FqIGvbXk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F644C113CD; Mon, 29 Apr 2024 15:59:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714406394; bh=CfhM0Hi7F1bxXQjfyx4hYuRdzA5vtBwb494TLMOky9s=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FqIGvbXkPAHS2F+MJ4JT+EjJk74BqYCwrH3TffpPjG1RrqYaglCoOeBeMT5IxCVaP gaPXL9ieS5lgLCXj3v/sk+wnF6GGbklcYialS0IPJUzaaN+Mp5jK2MChvFUQgsMk1A hYclBHT0ne0qL5IbNuaZHWslxbj1zZnGc1+SUmxz6DOKA5eY75YfFLjWy5+F0R/yoX ZqB5aMjPMHWAJGUow535lTtaqBNRRYMHgO9GMOrsCkdMv0aveOvFU4hLGDdrb4CDmf yP5uxiaWqG5r2oCLttUYGU/FpPZnPO0fsxxHIceoWZmA3f6Uz4wdoHR6jAOhSaX+jy oX0DJ/6kI2iHw== Date: Mon, 29 Apr 2024 10:59:51 -0500 From: Rob Herring To: Oreoluwa Babatunde Cc: saravanak@google.com, linux-kernel@vger.kernel.org, kernel@quicinc.com, devicetree@vger.kernel.org Subject: Re: [PATCH] of: reserved_mem: Remove the use of phandle from the reserved_mem APIs Message-ID: <171440638161.1895148.11194020129017609758.robh@kernel.org> References: <20240422235243.2878536-1-quic_obabatun@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240422235243.2878536-1-quic_obabatun@quicinc.com> On Mon, 22 Apr 2024 16:52:43 -0700, Oreoluwa Babatunde wrote: > The __find_rmem() function is the only place that references the phandle > field of the reserved_mem struct. __find_rmem() is used to match a > device_node object to its corresponding entry in the reserved_mem array > using its phandle value. But, there is already a function called > of_reserved_mem_lookup() which carries out the same action using the > name of the node. > > Using the of_reserved_mem_lookup() function is more reliable because > every node is gauranteed to have a name, but not all nodes will have a > phandle. > > Nodes are only assigned a phandle if they are explicitly defined in the > DT using "phandle = ", or if they are referenced by > another node in the DT. Hence, If the phandle field is empty, then > __find_rmem() will return a false negative. > > Hence, delete the __find_rmem() function and switch to using the > of_reserved_mem_lookup() function to find the corresponding entry of a > device_node in the reserved_mem array. Since the phandle field of the > reserved_mem struct is now unused, delete that as well. > > Signed-off-by: Oreoluwa Babatunde > --- > drivers/of/of_reserved_mem.c | 26 +++----------------------- > include/linux/of_reserved_mem.h | 1 - > 2 files changed, 3 insertions(+), 24 deletions(-) > Applied, thanks!