Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1761277lqm; Fri, 3 May 2024 06:04:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUgOlQDZ74yIXQqN3pueo2RnvcB51QD/4ilfzcAGkdEAfy19PNyyiAdh2HZ5iXNwpipDFXxJyQtYGCHH1avscKxOPrJ61jG3gqL1cJ1Xw== X-Google-Smtp-Source: AGHT+IFf1Sh6bNiaUiXNlADWZgO+JuwZl/sVGUEsYlMCbyAu9xgfAc5v/DG7HNAz7OOinYon0Xfo X-Received: by 2002:a54:480c:0:b0:3c7:3b4b:a0c7 with SMTP id j12-20020a54480c000000b003c73b4ba0c7mr2727212oij.11.1714741473525; Fri, 03 May 2024 06:04:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714741473; cv=pass; d=google.com; s=arc-20160816; b=HCEORyBYZika5byNguJUsEtekWKsP8tc0LxKPguZlmirzCYpjAX/oYI1XPWfbm5Z0r haozPRRcpI+Y8X9+0j4E5kBQJWXSb3GLoa/SrRgwH3doABRH4hlrpEXiI4/1JirFKe0P +UNEvbv99Nbqp/OKrxceVvVbLrK1HYgk5edL1Ydy6bVCsLuE10whbWb8Q11iOr+GggdA MIp+p62uOFo3ypmWbQETBhx1ThKLAXNsoXfJLOCYt+Du6ZCEYvMp+q3dOg4ezfX00ZUr 6KEJp+1V0GQEmViSNXld7n/ck3QU38pIuQfAp576IUFO5GM4Q5uDlpc947R31V+X4wu2 RSgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4zvMvculTiD34PTEoii3hDOSJLxc/acPGp67GCest7I=; fh=Vv69X/pp2DUCPIrg2paOuLidzgsolIzsJ3SFR5cJi24=; b=eqIOHBViMabRLMuOJd8QH+HV810Fx6uIH0OGOP8lX2BUfYWRgOBFz4Ftb66HXqdOk1 /+Ab4dAymVVYEjv9a+ibeUALjGxqgZs4fZVDHcep+4fmZAFGk0aKddW1/eIOyhBsnoV/ XRceysp+faOV9Oh9DbaSQCbk20xj9YKwaXlj+FWVYyZ9aWKpBLPOjngzERq0om62w2yF zk48WyRvjCxglgbaFHf5dZx6MPjkhJK4LodhzOMnaTd+FSMOWHKwV7Twbas7R4BR7MOz 061EYA4fEi4qn9tR4jTCThPZGFcoRD1TMRGX1Oh7+zlQW/gqHhQYcO7EHmU0zCZdJYoV LYVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L20zb0sy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167667-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v2-20020a056902108200b00de5adf52338si1039708ybu.711.2024.05.03.06.04.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 06:04:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L20zb0sy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167667-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167667-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 354791C21E81 for ; Fri, 3 May 2024 13:04:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9AD8415382D; Fri, 3 May 2024 13:03:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L20zb0sy" 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 ABC5E14A08F; Fri, 3 May 2024 13:03: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=1714741434; cv=none; b=G8TqxaPeZStqfbtVqCCbCukIFClWgGpIiOJjlGR7g6rfpzhwCgYiFNFjWMy18M0TcTEAY+RwQMUK/2qC4Igf4cIydoZZiF9y4lZez71xFBgEorKc9/XkJxZo5aNHodADLjPhlMxoChLF9+QePsf5ImQhmq23u1ODqRmmqLMhFPk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714741434; c=relaxed/simple; bh=QIJdpoviZQBKczshFO6NH+Q6b1BR6BVP5K2x2cfw8M0=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fYkJijhl6mVmniID2RQYlQbi0Y8gnjcX0h+xytQMsFcf1zjNlGULbjR6+ZbLkSSC63CYcCo4o893ZF0w5rAJdwyydb9bpbFWrL6slYwClOrMVrko/9xMe2bLnHxPXMuzxqNfiFoAJ4WRcqLJY9/prUmtVpC5N3Jsw/vtDcjU4vA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L20zb0sy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A2D8C4AF19; Fri, 3 May 2024 13:03:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714741434; bh=QIJdpoviZQBKczshFO6NH+Q6b1BR6BVP5K2x2cfw8M0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L20zb0syXQqT/bJxeRTAZpS2P5t8Wp5z8WWcQhrjyVHrGBgkHZYAN4eYy3U0kV9zF vH2LBpfSSM3DpC48YQY6at2YXE7PEIXPPRhQ/xY1LolKZ4joS59oGC2IH6PqQ1xANu 7t2sVikXICxJncM5CQZM5c6dvJLJfqi6NzQ0KYJ+ku/UhVZLI+xqH0DORUj3lQ/4GG as0i7kpeMAGWEwm787hKnyRiMRKyXZ3P9oZ6HIBV3PpO6IFKWz50IYJ890ManBJ/+b KS0LSkSCLvOxnxKnk7P5VSaKMZmyCx0Zar+LifCWmgW+zRmiEJUxAsIJmtPu6kP4VK 8HfBpT2WD56Hg== Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-51f0b6b682fso2463437e87.1; Fri, 03 May 2024 06:03:54 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWmHGCH7MW5oAhJHjxUsmjDWMIukJg6dyzGBspNBPcYXFTPRiLmFO9n8IdjpBnGnY1ieomUiVwMWaniAwqiNLEsA5RpFB2ynom8y+YXC/SG8Fuqtj/obkzyPQob4Db5aL8J224kXjixMA== X-Gm-Message-State: AOJu0Yxulkk59e/VKfyWZfZJI3xZH1PvOzfkH89Dhea+c5B/AK0GPW3A N+JRTxpeMB5OBH7wXwwaGejsP6upQkR+QoXJ9ez7JouM8C8LGB9zH/IyBx5VM+Ty7QiUNQgbMIA 5ZMAW4m2wOtMNKrrbWFvy3hXPbw== X-Received: by 2002:a05:6512:3b08:b0:51a:e305:eb20 with SMTP id f8-20020a0565123b0800b0051ae305eb20mr3012638lfv.17.1714741432515; Fri, 03 May 2024 06:03:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240502192403.3307277-1-quic_obabatun@quicinc.com> In-Reply-To: <20240502192403.3307277-1-quic_obabatun@quicinc.com> From: Rob Herring Date: Fri, 3 May 2024 08:03:39 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] of: reserved_mem: Remove the use of phandle from the reserved_mem APIs To: Oreoluwa Babatunde Cc: saravanak@google.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, May 2, 2024 at 2:24=E2=80=AFPM 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 guaranteed 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 =3D ", 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 > --- > v2: > - Addressed error found by kernel test bot: > https://lore.kernel.org/all/202405020127.3ncxx3EI-lkp@intel.com/ > - Fixed spelling error in commit text. > > v1: > https://lore.kernel.org/all/20240422235243.2878536-1-quic_obabatun@quicin= c.com/ > > drivers/of/of_reserved_mem.c | 22 +--------------------- > include/linux/of_reserved_mem.h | 1 - > 2 files changed, 1 insertion(+), 22 deletions(-) Applied, thanks.