diff options
author | NĂcolas F. R. A. Prado <nfraprado@collabora.com> | 2024-02-12 17:50:07 +0300 |
---|---|---|
committer | Tzung-Bi Shih <tzungbi@kernel.org> | 2024-02-17 03:53:06 +0300 |
commit | 8a0a62941a042612f7487f6c4ff291f9054ff214 (patch) | |
tree | fe15f68ecdbcdd38f4bdc3f07ed03f5153ebe0ff /drivers/firmware/google/coreboot_table.c | |
parent | f1cebae1dbf85f9de65c13a2d9f5cc3be7e51dc4 (diff) | |
download | linux-8a0a62941a042612f7487f6c4ff291f9054ff214.tar.xz |
firmware: coreboot: Replace tag with id table in driver struct
Switch the plain 'tag' field in struct coreboot_driver for the newly
created coreboot_device_id struct, which also contains a tag field and
has the benefit of allowing modalias generation, and update all coreboot
drivers accordingly.
While at it, also add the id table for each driver to the module device
table to allow automatically loading the module.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: NĂcolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20240212-coreboot-mod-defconfig-v4-3-d14172676f6d@collabora.com
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Diffstat (limited to 'drivers/firmware/google/coreboot_table.c')
-rw-r--r-- | drivers/firmware/google/coreboot_table.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/firmware/google/coreboot_table.c b/drivers/firmware/google/coreboot_table.c index 234cebf376d9..d4b6e581a6c6 100644 --- a/drivers/firmware/google/coreboot_table.c +++ b/drivers/firmware/google/coreboot_table.c @@ -28,8 +28,17 @@ static int coreboot_bus_match(struct device *dev, struct device_driver *drv) { struct coreboot_device *device = CB_DEV(dev); struct coreboot_driver *driver = CB_DRV(drv); + const struct coreboot_device_id *id; - return device->entry.tag == driver->tag; + if (!driver->id_table) + return 0; + + for (id = driver->id_table; id->tag; id++) { + if (device->entry.tag == id->tag) + return 1; + } + + return 0; } static int coreboot_bus_probe(struct device *dev) |