From a6404e6e5a0e2933e10be3e42311ee6b65b821fc Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Tue, 21 Nov 2017 15:04:52 +0100 Subject: [PATCH] staging: most: core: track aim modules with linked list The core needs to know what modules are registered. This patch makes the core keep track of the registered modules. Signed-off-by: Christian Gromm Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/core.c | 6 ++++-- drivers/staging/most/core.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c index 779464a58674..41a35382a9e3 100644 --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -1294,8 +1294,8 @@ int most_register_aim(struct most_aim *aim) pr_err("registering device %s failed\n", aim->name); return ret; } - pr_info("registered new application interfacing module %s\n", - aim->name); + list_add_tail(&aim->list, &mc.mod_list); + pr_info("registered new application interfacing module %s\n", aim->name); return 0; } EXPORT_SYMBOL_GPL(most_register_aim); @@ -1326,6 +1326,7 @@ int most_deregister_aim(struct most_aim *aim) } } device_unregister(&aim->dev); + list_del(&aim->list); pr_info("deregistering application interfacing module %s\n", aim->name); return 0; } @@ -1545,6 +1546,7 @@ static int __init most_init(void) pr_info("init()\n"); INIT_LIST_HEAD(&instance_list); + INIT_LIST_HEAD(&mc.mod_list); ida_init(&mdev_id); mc.bus.name = "most", diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h index 29595d9ef7ed..845e1d63d8fc 100644 --- a/drivers/staging/most/core.h +++ b/drivers/staging/most/core.h @@ -263,6 +263,7 @@ struct most_interface { */ struct most_aim { struct device dev; + struct list_head list; const char *name; int (*probe_channel)(struct most_interface *iface, int channel_idx, struct most_channel_config *cfg, char *name);