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

mcb: Add missing modpost build support

mcb bus is not prepared to autoload client drivers with the data defined on
the drivers' MODULE_DEVICE_TABLE. modpost cannot access to mcb_table_id
inside MODULE_DEVICE_TABLE so the data declared inside is ignored.

Add modpost build support for accessing to the mcb_table_id coded on device
drivers' MODULE_DEVICE_TABLE.

Fixes: 3764e82e5150 ("drivers: Introduce MEN Chameleon Bus")
Reviewed-by: Jorge Sanjuan Garcia <dev-jorge.sanjuangarcia@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Link: https://patch.msgid.link/20251202084200.10410-1-dev-josejavier.rodriguez@duagon.com
Signed-off-by: Nicolas Schier <nsc@kernel.org>

authored by

Jose Javier Rodriguez Barbarin and committed by
Nicolas Schier
1f4ea483 b08fc4d0

+12
+3
scripts/mod/devicetable-offsets.c
··· 199 199 DEVID(cpu_feature); 200 200 DEVID_FIELD(cpu_feature, feature); 201 201 202 + DEVID(mcb_device_id); 203 + DEVID_FIELD(mcb_device_id, device); 204 + 202 205 DEVID(mei_cl_device_id); 203 206 DEVID_FIELD(mei_cl_device_id, name); 204 207 DEVID_FIELD(mei_cl_device_id, uuid);
+9
scripts/mod/file2alias.c
··· 1110 1110 module_alias_printf(mod, false, "cpu:type:*:feature:*%04X*", feature); 1111 1111 } 1112 1112 1113 + /* Looks like: mcb:16zN */ 1114 + static void do_mcb_entry(struct module *mod, void *symval) 1115 + { 1116 + DEF_FIELD(symval, mcb_device_id, device); 1117 + 1118 + module_alias_printf(mod, false, "mcb:16z%03d", device); 1119 + } 1120 + 1113 1121 /* Looks like: mei:S:uuid:N:* */ 1114 1122 static void do_mei_entry(struct module *mod, void *symval) 1115 1123 { ··· 1452 1444 {"mipscdmm", SIZE_mips_cdmm_device_id, do_mips_cdmm_entry}, 1453 1445 {"x86cpu", SIZE_x86_cpu_id, do_x86cpu_entry}, 1454 1446 {"cpu", SIZE_cpu_feature, do_cpu_entry}, 1447 + {"mcb", SIZE_mcb_device_id, do_mcb_entry}, 1455 1448 {"mei", SIZE_mei_cl_device_id, do_mei_entry}, 1456 1449 {"rapidio", SIZE_rio_device_id, do_rio_entry}, 1457 1450 {"ulpi", SIZE_ulpi_device_id, do_ulpi_entry},