All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper
@ 2022-10-27  6:56 Yang Yingliang
  2022-10-28 11:24 ` Thierry Reding
  2023-04-05 13:19 ` Thierry Reding
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-10-27  6:56 UTC (permalink / raw)
  To: linux-tegra; +Cc: thierry.reding, jonathanh, yangyingliang

After commit 16988c742968 ("of/address: introduce of_address_count() helper"),
We can use of_address_count() to instead of open-coding it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/soc/tegra/cbb/tegra194-cbb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/tegra/cbb/tegra194-cbb.c b/drivers/soc/tegra/cbb/tegra194-cbb.c
index 1ae0bd9a1ac1..b5676dd49e88 100644
--- a/drivers/soc/tegra/cbb/tegra194-cbb.c
+++ b/drivers/soc/tegra/cbb/tegra194-cbb.c
@@ -2191,7 +2191,6 @@ MODULE_DEVICE_TABLE(of, tegra194_cbb_match);
 static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np)
 {
 	struct tegra_cbb *entry;
-	struct resource res;
 	unsigned long flags;
 	unsigned int i;
 	int err;
@@ -2211,8 +2210,7 @@ static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node
 	spin_unlock_irqrestore(&cbb_lock, flags);
 
 	if (!cbb->bridges) {
-		while (of_address_to_resource(np, cbb->num_bridges, &res) == 0)
-			cbb->num_bridges++;
+		cbb->num_bridges = of_address_count(np);
 
 		cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges,
 					    sizeof(*cbb->bridges), GFP_KERNEL);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper
  2022-10-27  6:56 [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper Yang Yingliang
@ 2022-10-28 11:24 ` Thierry Reding
  2023-04-05 13:19 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2022-10-28 11:24 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-tegra, jonathanh

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

On Thu, Oct 27, 2022 at 02:56:25PM +0800, Yang Yingliang wrote:
> After commit 16988c742968 ("of/address: introduce of_address_count() helper"),
> We can use of_address_count() to instead of open-coding it.
> 
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/soc/tegra/cbb/tegra194-cbb.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

That commit is only in linux-next for now, so I can't apply this yet.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper
  2022-10-27  6:56 [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper Yang Yingliang
  2022-10-28 11:24 ` Thierry Reding
@ 2023-04-05 13:19 ` Thierry Reding
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2023-04-05 13:19 UTC (permalink / raw)
  To: Yang Yingliang, linux-tegra; +Cc: jonathanh, thierry.reding

From: Thierry Reding <treding@nvidia.com>

On Thu, 27 Oct 2022 14:56:25 +0800, Yang Yingliang wrote:
> After commit 16988c742968 ("of/address: introduce of_address_count() helper"),
> We can use of_address_count() to instead of open-coding it.
> 
> 

Applied, thanks!

[1/1] soc/tegra: cbb: tegra194: use of_address_count() helper
      (no commit info)

Best regards,
-- 
Thierry Reding <treding@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-04-05 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27  6:56 [PATCH -next] soc/tegra: cbb: tegra194: use of_address_count() helper Yang Yingliang
2022-10-28 11:24 ` Thierry Reding
2023-04-05 13:19 ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.