Skip to content

Commit 3eb030c

Browse files
hcodinarobherring
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
1 parent 42604f8 commit 3eb030c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

drivers/of/address.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
216216
return da - cp;
217217
}
218218

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-
}
223219
#endif /* CONFIG_PCI */
224220

225221
/*
@@ -343,11 +339,6 @@ static u64 of_bus_isa_map(__be32 *addr, const __be32 *range, int na, int ns,
343339
return da - cp;
344340
}
345341

346-
static int of_bus_isa_translate(__be32 *addr, u64 offset, int na)
347-
{
348-
return of_bus_default_translate(addr + 1, offset, na - 1);
349-
}
350-
351342
static unsigned int of_bus_isa_get_flags(const __be32 *addr)
352343
{
353344
unsigned int flags = 0;
@@ -378,7 +369,7 @@ static struct of_bus of_busses[] = {
378369
.match = of_bus_pci_match,
379370
.count_cells = of_bus_pci_count_cells,
380371
.map = of_bus_pci_map,
381-
.translate = of_bus_pci_translate,
372+
.translate = of_bus_default_flags_translate,
382373
.has_flags = true,
383374
.get_flags = of_bus_pci_get_flags,
384375
},
@@ -390,7 +381,7 @@ static struct of_bus of_busses[] = {
390381
.match = of_bus_isa_match,
391382
.count_cells = of_bus_isa_count_cells,
392383
.map = of_bus_isa_map,
393-
.translate = of_bus_isa_translate,
384+
.translate = of_bus_default_flags_translate,
394385
.has_flags = true,
395386
.get_flags = of_bus_isa_get_flags,
396387
},

0 commit comments

Comments
 (0)