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 <christian.gromm@microchip.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Christian Gromm 2017-11-21 15:04:52 +01:00 committed by Greg Kroah-Hartman
parent 14ae5f0383
commit a6404e6e5a
2 changed files with 5 additions and 2 deletions

View File

@ -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",

View File

@ -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);