[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1551418672-12822-4-git-send-email-parav@mellanox.com>
Date: Thu, 28 Feb 2019 23:37:47 -0600
From: Parav Pandit <parav@...lanox.com>
To: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
michal.lkml@...kovi.net, davem@...emloft.net,
gregkh@...uxfoundation.org, jiri@...lanox.com
Cc: parav@...lanox.com
Subject: [RFC net-next 3/8] modpost: Add support for subdev device id table
Add support to parse subdev module device id table.
Signed-off-by: Parav Pandit <parav@...lanox.com>
---
scripts/mod/devicetable-offsets.c | 4 ++++
scripts/mod/file2alias.c | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 2930044..77f6b6e 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -225,5 +225,9 @@ int main(void)
DEVID_FIELD(typec_device_id, svid);
DEVID_FIELD(typec_device_id, mode);
+ DEVID(subdev_id);
+ DEVID_FIELD(subdev_id, vendor_id);
+ DEVID_FIELD(subdev_id, device_id);
+
return 0;
}
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a37af7d..be89e8e 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1287,6 +1287,20 @@ static int do_typec_entry(const char *filename, void *symval, char *alias)
return 1;
}
+/* Looks like: subdev:vNdN. */
+static int do_subdev_entry(const char *filename, void *symval, char *alias)
+{
+ DEF_FIELD(symval, subdev_id, vendor_id);
+ DEF_FIELD(symval, subdev_id, device_id);
+
+ strcpy(alias, "subdev:");
+ ADD(alias, "v", 1, vendor_id);
+ ADD(alias, "d", 1, device_id);
+
+ add_wildcard(alias);
+ return 1;
+}
+
/* Does namelen bytes of name exactly match the symbol? */
static bool sym_is(const char *name, unsigned namelen, const char *symbol)
{
@@ -1357,6 +1371,7 @@ static void do_table(void *symval, unsigned long size,
{"fslmc", SIZE_fsl_mc_device_id, do_fsl_mc_entry},
{"tbsvc", SIZE_tb_service_id, do_tbsvc_entry},
{"typec", SIZE_typec_device_id, do_typec_entry},
+ {"subdev", SIZE_subdev_id, do_subdev_entry},
};
/* Create MODULE_ALIAS() statements.
--
1.8.3.1
Powered by blists - more mailing lists