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

staging: most: rename functions to register a driver with most_core

This patch renames the functions to register and deregister a component
module with the core. It is needed because the modules that interface the
userspace are referred to as components.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1284441
...@@ -518,7 +518,7 @@ static int __init mod_init(void) ...@@ -518,7 +518,7 @@ static int __init mod_init(void)
err = PTR_ERR(aim_class); err = PTR_ERR(aim_class);
goto free_cdev; goto free_cdev;
} }
err = most_register_aim(&cdev_aim); err = most_register_component(&cdev_aim);
if (err) if (err)
goto dest_class; goto dest_class;
return 0; return 0;
...@@ -538,7 +538,7 @@ static void __exit mod_exit(void) ...@@ -538,7 +538,7 @@ static void __exit mod_exit(void)
pr_info("exit module\n"); pr_info("exit module\n");
most_deregister_aim(&cdev_aim); most_deregister_component(&cdev_aim);
list_for_each_entry_safe(c, tmp, &channel_list, list) { list_for_each_entry_safe(c, tmp, &channel_list, list) {
destroy_cdev(c); destroy_cdev(c);
......
...@@ -69,6 +69,7 @@ struct most_channel { ...@@ -69,6 +69,7 @@ struct most_channel {
struct list_head trash_fifo; struct list_head trash_fifo;
struct task_struct *hdm_enqueue_task; struct task_struct *hdm_enqueue_task;
wait_queue_head_t hdm_fifo_wq; wait_queue_head_t hdm_fifo_wq;
}; };
#define to_channel(d) container_of(d, struct most_channel, dev) #define to_channel(d) container_of(d, struct most_channel, dev)
...@@ -1299,10 +1300,10 @@ int most_stop_channel(struct most_interface *iface, int id, ...@@ -1299,10 +1300,10 @@ int most_stop_channel(struct most_interface *iface, int id,
EXPORT_SYMBOL_GPL(most_stop_channel); EXPORT_SYMBOL_GPL(most_stop_channel);
/** /**
* most_register_aim - registers an AIM (driver) with the core * most_register_component - registers an AIM (driver) with the core
* @aim: instance of AIM to be registered * @aim: instance of AIM to be registered
*/ */
int most_register_aim(struct core_component *aim) int most_register_component(struct core_component *aim)
{ {
if (!aim) { if (!aim) {
pr_err("Bad driver\n"); pr_err("Bad driver\n");
...@@ -1312,7 +1313,7 @@ int most_register_aim(struct core_component *aim) ...@@ -1312,7 +1313,7 @@ int most_register_aim(struct core_component *aim)
pr_info("registered new application interfacing module %s\n", 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_component);
static int disconnect_channels(struct device *dev, void *data) static int disconnect_channels(struct device *dev, void *data)
{ {
...@@ -1333,10 +1334,10 @@ static int disconnect_channels(struct device *dev, void *data) ...@@ -1333,10 +1334,10 @@ static int disconnect_channels(struct device *dev, void *data)
} }
/** /**
* most_deregister_aim - deregisters an AIM (driver) with the core * most_deregister_component - deregisters an AIM (driver) with the core
* @aim: AIM to be removed * @aim: AIM to be removed
*/ */
int most_deregister_aim(struct core_component *aim) int most_deregister_component(struct core_component *aim)
{ {
if (!aim) { if (!aim) {
pr_err("Bad driver\n"); pr_err("Bad driver\n");
...@@ -1348,7 +1349,7 @@ int most_deregister_aim(struct core_component *aim) ...@@ -1348,7 +1349,7 @@ int most_deregister_aim(struct core_component *aim)
pr_info("deregistering module %s\n", aim->name); pr_info("deregistering module %s\n", aim->name);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(most_deregister_aim); EXPORT_SYMBOL_GPL(most_deregister_component);
static void release_interface(struct device *dev) static void release_interface(struct device *dev)
{ {
......
...@@ -308,8 +308,8 @@ void most_stop_enqueue(struct most_interface *iface, int channel_idx); ...@@ -308,8 +308,8 @@ void most_stop_enqueue(struct most_interface *iface, int channel_idx);
* in wait fifo. * in wait fifo.
*/ */
void most_resume_enqueue(struct most_interface *iface, int channel_idx); void most_resume_enqueue(struct most_interface *iface, int channel_idx);
int most_register_aim(struct core_component *comp); int most_register_component(struct core_component *comp);
int most_deregister_aim(struct core_component *comp); int most_deregister_component(struct core_component *comp);
struct mbo *most_get_mbo(struct most_interface *iface, int channel_idx, struct mbo *most_get_mbo(struct most_interface *iface, int channel_idx,
struct core_component *comp); struct core_component *comp);
void most_put_mbo(struct mbo *mbo); void most_put_mbo(struct mbo *mbo);
......
...@@ -506,12 +506,12 @@ static int __init most_net_init(void) ...@@ -506,12 +506,12 @@ static int __init most_net_init(void)
{ {
spin_lock_init(&list_lock); spin_lock_init(&list_lock);
mutex_init(&probe_disc_mt); mutex_init(&probe_disc_mt);
return most_register_aim(&aim); return most_register_component(&aim);
} }
static void __exit most_net_exit(void) static void __exit most_net_exit(void)
{ {
most_deregister_aim(&aim); most_deregister_component(&aim);
} }
/** /**
......
...@@ -733,7 +733,7 @@ static int __init audio_init(void) ...@@ -733,7 +733,7 @@ static int __init audio_init(void)
INIT_LIST_HEAD(&dev_list); INIT_LIST_HEAD(&dev_list);
return most_register_aim(&audio_aim); return most_register_component(&audio_aim);
} }
static void __exit audio_exit(void) static void __exit audio_exit(void)
...@@ -747,7 +747,7 @@ static void __exit audio_exit(void) ...@@ -747,7 +747,7 @@ static void __exit audio_exit(void)
snd_card_free(channel->card); snd_card_free(channel->card);
} }
most_deregister_aim(&audio_aim); most_deregister_component(&audio_aim);
} }
module_init(audio_init); module_init(audio_init);
......
...@@ -572,7 +572,7 @@ static struct core_component aim_info = { ...@@ -572,7 +572,7 @@ static struct core_component aim_info = {
static int __init aim_init(void) static int __init aim_init(void)
{ {
spin_lock_init(&list_lock); spin_lock_init(&list_lock);
return most_register_aim(&aim_info); return most_register_component(&aim_info);
} }
static void __exit aim_exit(void) static void __exit aim_exit(void)
...@@ -581,7 +581,7 @@ static void __exit aim_exit(void) ...@@ -581,7 +581,7 @@ static void __exit aim_exit(void)
/* /*
* As the mostcore currently doesn't call disconnect_channel() * As the mostcore currently doesn't call disconnect_channel()
* for linked channels while we call most_deregister_aim() * for linked channels while we call most_deregister_component()
* we simulate this call here. * we simulate this call here.
* This must be fixed in core. * This must be fixed in core.
*/ */
...@@ -597,7 +597,7 @@ static void __exit aim_exit(void) ...@@ -597,7 +597,7 @@ static void __exit aim_exit(void)
} }
spin_unlock_irq(&list_lock); spin_unlock_irq(&list_lock);
most_deregister_aim(&aim_info); most_deregister_component(&aim_info);
BUG_ON(!list_empty(&video_devices)); BUG_ON(!list_empty(&video_devices));
} }
......
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