Skip to content

Commit 056a6e1

Browse files
Yang Yingliangthierryreding
authored andcommitted
soc/tegra: cbb: tegra194: Use of_address_count() helper
After commit 16988c7 ("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> Signed-off-by: Thierry Reding <treding@nvidia.com>
1 parent 6854f27 commit 056a6e1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/soc/tegra/cbb/tegra194-cbb.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,7 +2190,6 @@ MODULE_DEVICE_TABLE(of, tegra194_cbb_match);
21902190
static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np)
21912191
{
21922192
struct tegra_cbb *entry;
2193-
struct resource res;
21942193
unsigned long flags;
21952194
unsigned int i;
21962195
int err;
@@ -2210,8 +2209,7 @@ static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node
22102209
spin_unlock_irqrestore(&cbb_lock, flags);
22112210

22122211
if (!cbb->bridges) {
2213-
while (of_address_to_resource(np, cbb->num_bridges, &res) == 0)
2214-
cbb->num_bridges++;
2212+
cbb->num_bridges = of_address_count(np);
22152213

22162214
cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges,
22172215
sizeof(*cbb->bridges), GFP_KERNEL);

0 commit comments

Comments
 (0)