[PATCH v2 4/7] firmware: google: vpd: Add to module device table

Nícolas F. R. A. Prado
2024-01-12T13:21:29Z

Create an id table and add it to the module device table to allow the
vpd driver to be automatically loaded when a matching device is found.

Suggested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

---

Changes in v2:
- Added this commit

drivers/firmware/google/vpd.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/firmware/google/vpd.c b/drivers/firmware/google/vpd.c
index ee6e08c0592b..9e9fe9ca1920 100644
--- a/drivers/firmware/google/vpd.c
+++ b/drivers/firmware/google/vpd.c
@@ -14,6 +14,7 @@
#include <linux/kobject.h>
#include <linux/list.h>
#include <linux/module.h>
+#include <linux/mod_devicetable.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -306,6 +307,12 @@ static void vpd_remove(struct coreboot_device *dev)
kobject_put(vpd_kobj);
}

+static const struct coreboot_device_id vpd_ids[] = {
+ { .tag = CB_TAG_VPD },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(coreboot, vpd_ids);
+
static struct coreboot_driver vpd_driver = {
.probe = vpd_probe,
.remove = vpd_remove,
--
2.43.0