Skip to content

Commit c58854c

Browse files
committed
modpost: convert do_of_table() to a generic handler
do_of_table() no longer needs to iterate over the of_device_id array. Convert it to a generic ->do_entry() handler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 600dbaf commit c58854c

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

scripts/mod/file2alias.c

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ static void do_usb_table(void *symval, unsigned long size,
398398
do_usb_entry_multi(symval + i, mod);
399399
}
400400

401-
static void do_of_entry_multi(void *symval, struct module *mod)
401+
static void do_of_entry(struct module *mod, void *symval)
402402
{
403403
char alias[500];
404404
int len;
@@ -424,21 +424,6 @@ static void do_of_entry_multi(void *symval, struct module *mod)
424424
module_alias_printf(mod, false, "%sC*", alias);
425425
}
426426

427-
static void do_of_table(void *symval, unsigned long size,
428-
struct module *mod)
429-
{
430-
unsigned int i;
431-
const unsigned long id_size = SIZE_of_device_id;
432-
433-
device_id_check(mod->name, "of", size, id_size, symval);
434-
435-
/* Leave last one: it's the terminator. */
436-
size -= id_size;
437-
438-
for (i = 0; i < size; i += id_size)
439-
do_of_entry_multi(symval + i, mod);
440-
}
441-
442427
/* Looks like: hid:bNvNpN */
443428
static void do_hid_entry(struct module *mod, void *symval)
444429
{
@@ -1520,6 +1505,7 @@ static const struct devtable devtable[] = {
15201505
{"cdx", SIZE_cdx_device_id, do_cdx_entry},
15211506
{"vchiq", SIZE_vchiq_device_id, do_vchiq_entry},
15221507
{"coreboot", SIZE_coreboot_device_id, do_coreboot_entry},
1508+
{"of", SIZE_of_device_id, do_of_entry},
15231509
{"pnp", SIZE_pnp_device_id, do_pnp_device_entry},
15241510
{"pnp_card", SIZE_pnp_card_device_id, do_pnp_card_entry},
15251511
};
@@ -1568,8 +1554,6 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
15681554
/* First handle the "special" cases */
15691555
if (sym_is(name, namelen, "usb"))
15701556
do_usb_table(symval, sym->st_size, mod);
1571-
else if (sym_is(name, namelen, "of"))
1572-
do_of_table(symval, sym->st_size, mod);
15731557
else {
15741558
int i;
15751559

0 commit comments

Comments
 (0)