Commit a6404e6e authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

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: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14ae5f03
...@@ -1294,8 +1294,8 @@ int most_register_aim(struct most_aim *aim) ...@@ -1294,8 +1294,8 @@ int most_register_aim(struct most_aim *aim)
pr_err("registering device %s failed\n", aim->name); pr_err("registering device %s failed\n", aim->name);
return ret; return ret;
} }
pr_info("registered new application interfacing module %s\n", list_add_tail(&aim->list, &mc.mod_list);
aim->name); pr_info("registered new application interfacing module %s\n", aim->name);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(most_register_aim); EXPORT_SYMBOL_GPL(most_register_aim);
...@@ -1326,6 +1326,7 @@ int most_deregister_aim(struct most_aim *aim) ...@@ -1326,6 +1326,7 @@ int most_deregister_aim(struct most_aim *aim)
} }
} }
device_unregister(&aim->dev); device_unregister(&aim->dev);
list_del(&aim->list);
pr_info("deregistering application interfacing module %s\n", aim->name); pr_info("deregistering application interfacing module %s\n", aim->name);
return 0; return 0;
} }
...@@ -1545,6 +1546,7 @@ static int __init most_init(void) ...@@ -1545,6 +1546,7 @@ static int __init most_init(void)
pr_info("init()\n"); pr_info("init()\n");
INIT_LIST_HEAD(&instance_list); INIT_LIST_HEAD(&instance_list);
INIT_LIST_HEAD(&mc.mod_list);
ida_init(&mdev_id); ida_init(&mdev_id);
mc.bus.name = "most", mc.bus.name = "most",
......
...@@ -263,6 +263,7 @@ struct most_interface { ...@@ -263,6 +263,7 @@ struct most_interface {
*/ */
struct most_aim { struct most_aim {
struct device dev; struct device dev;
struct list_head list;
const char *name; const char *name;
int (*probe_channel)(struct most_interface *iface, int channel_idx, int (*probe_channel)(struct most_interface *iface, int channel_idx,
struct most_channel_config *cfg, char *name); struct most_channel_config *cfg, char *name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment