Skip to content

Commit c2b28f6

Browse files
nfrapradoTzung-Bi Shih
authored andcommitted
firmware: coreboot: Generate modalias uevent for devices
Generate a modalias uevent for devices in the coreboot bus to allow userspace to automatically load the corresponding modules. Acked-by: Brian Norris <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Brian Norris <[email protected]> Signed-off-by: Nícolas F. R. A. Prado <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent e3c5df1 commit c2b28f6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/firmware/google/coreboot_table.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,20 @@ static void coreboot_bus_remove(struct device *dev)
5353
driver->remove(device);
5454
}
5555

56+
static int coreboot_bus_uevent(const struct device *dev, struct kobj_uevent_env *env)
57+
{
58+
struct coreboot_device *device = CB_DEV(dev);
59+
u32 tag = device->entry.tag;
60+
61+
return add_uevent_var(env, "MODALIAS=coreboot:t%08X", tag);
62+
}
63+
5664
static const struct bus_type coreboot_bus_type = {
5765
.name = "coreboot",
5866
.match = coreboot_bus_match,
5967
.probe = coreboot_bus_probe,
6068
.remove = coreboot_bus_remove,
69+
.uevent = coreboot_bus_uevent,
6170
};
6271

6372
static void coreboot_device_release(struct device *dev)

0 commit comments

Comments
 (0)