Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcma: Use of_address_to_resource()

Replace of_get_address() and of_translate_address() calls with single
call to of_address_to_resource().

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230319163159.225773-1-robh@kernel.org

authored by

Rob Herring and committed by
Kalle Valo
767d011d 074d0a1a

+5 -5
+5 -5
drivers/bcma/main.c
··· 140 140 struct bcma_device *core) 141 141 { 142 142 struct device_node *node; 143 - u64 size; 144 - const __be32 *reg; 143 + int ret; 145 144 146 145 if (!parent->of_node) 147 146 return NULL; 148 147 149 148 for_each_child_of_node(parent->of_node, node) { 150 - reg = of_get_address(node, 0, &size, NULL); 151 - if (!reg) 149 + struct resource res; 150 + ret = of_address_to_resource(node, 0, &res); 151 + if (ret) 152 152 continue; 153 - if (of_translate_address(node, reg) == core->addr) 153 + if (res.start == core->addr) 154 154 return node; 155 155 } 156 156 return NULL;