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

of: address: Remove duplicated functions

The recently added of_bus_default_flags_translate() performs the exact
same operation as of_bus_pci_translate() and of_bus_isa_translate().

Avoid duplicated code replacing both of_bus_pci_translate() and
of_bus_isa_translate() with of_bus_default_flags_translate().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Link: https://lore.kernel.org/r/20231017110221.189299-3-herve.codina@bootlin.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Herve Codina and committed by
Rob Herring
3eb030c6 42604f8e

+2 -11
+2 -11
drivers/of/address.c
··· 216 216 return da - cp; 217 217 } 218 218 219 - static int of_bus_pci_translate(__be32 *addr, u64 offset, int na) 220 - { 221 - return of_bus_default_translate(addr + 1, offset, na - 1); 222 - } 223 219 #endif /* CONFIG_PCI */ 224 220 225 221 /* ··· 339 343 return da - cp; 340 344 } 341 345 342 - static int of_bus_isa_translate(__be32 *addr, u64 offset, int na) 343 - { 344 - return of_bus_default_translate(addr + 1, offset, na - 1); 345 - } 346 - 347 346 static unsigned int of_bus_isa_get_flags(const __be32 *addr) 348 347 { 349 348 unsigned int flags = 0; ··· 369 378 .match = of_bus_pci_match, 370 379 .count_cells = of_bus_pci_count_cells, 371 380 .map = of_bus_pci_map, 372 - .translate = of_bus_pci_translate, 381 + .translate = of_bus_default_flags_translate, 373 382 .has_flags = true, 374 383 .get_flags = of_bus_pci_get_flags, 375 384 }, ··· 381 390 .match = of_bus_isa_match, 382 391 .count_cells = of_bus_isa_count_cells, 383 392 .map = of_bus_isa_map, 384 - .translate = of_bus_isa_translate, 393 + .translate = of_bus_default_flags_translate, 385 394 .has_flags = true, 386 395 .get_flags = of_bus_isa_get_flags, 387 396 },