From a12844410c4350305b9ae1c1e0c5d6bd87297e6b Mon Sep 17 00:00:00 2001 From: Christian Gromm Date: Tue, 21 Nov 2017 15:05:00 +0100 Subject: staging: most: rename struct most_aim The designator of a module that proivdes means to interface userspace is called an AIM. Since this name seems to be unappropiate, this kind of moduels are going to be referred to as componetns. This is done because such modules function as components to enhance the core with new features. This patch renames the struct most_aim to core_component. Signed-off-by: Christian Gromm Signed-off-by: Greg Kroah-Hartman --- drivers/staging/most/cdev/cdev.c | 4 ++-- drivers/staging/most/core.c | 30 +++++++++++++++--------------- drivers/staging/most/core.h | 16 +++++++--------- drivers/staging/most/net/net.c | 4 ++-- drivers/staging/most/sound/sound.c | 6 +++--- drivers/staging/most/video/video.c | 4 ++-- 6 files changed, 31 insertions(+), 33 deletions(-) diff --git a/drivers/staging/most/cdev/cdev.c b/drivers/staging/most/cdev/cdev.c index cd23db574d5f..a45a4dcbeb9b 100644 --- a/drivers/staging/most/cdev/cdev.c +++ b/drivers/staging/most/cdev/cdev.c @@ -22,7 +22,7 @@ static dev_t aim_devno; static struct class *aim_class; static struct ida minor_id; static unsigned int major; -static struct most_aim cdev_aim; +static struct core_component cdev_aim; struct aim_channel { wait_queue_head_t wq; @@ -489,7 +489,7 @@ error_alloc_channel: return retval; } -static struct most_aim cdev_aim = { +static struct core_component cdev_aim = { .name = "cdev", .probe_channel = aim_probe, .disconnect_channel = aim_disconnect_channel, diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c index 2b0c85c60c20..520b851c5bf8 100644 --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -40,7 +40,7 @@ static struct mostcore { #define to_driver(d) container_of(d, struct mostcore, drv); struct pipe { - struct most_aim *aim; + struct core_component *aim; int refs; int num_buffers; }; @@ -530,9 +530,9 @@ static const struct attribute_group *interface_attr_groups[] = { /* ___ ___ * ___A I M___ */ -static struct most_aim *match_module(char *name) +static struct core_component *match_module(char *name) { - struct most_aim *aim; + struct core_component *aim; list_for_each_entry(aim, &mc.mod_list, list) { if (!strcmp(aim->name, name)) @@ -577,7 +577,7 @@ static ssize_t links_show(struct device_driver *drv, char *buf) static ssize_t modules_show(struct device_driver *drv, char *buf) { - struct most_aim *aim; + struct core_component *aim; int offs = 0; list_for_each_entry(aim, &mc.mod_list, list) { @@ -660,11 +660,11 @@ static struct most_channel *get_channel(char *mdev, char *mdev_ch) } static -inline int link_channel_to_aim(struct most_channel *c, struct most_aim *aim, +inline int link_channel_to_aim(struct most_channel *c, struct core_component *aim, char *aim_param) { int ret; - struct most_aim **aim_ptr; + struct core_component **aim_ptr; if (!c->pipe0.aim) aim_ptr = &c->pipe0.aim; @@ -711,7 +711,7 @@ static ssize_t add_link_store(struct device_driver *drv, size_t len) { struct most_channel *c; - struct most_aim *aim; + struct core_component *aim; char buffer[STRING_SIZE]; char *mdev; char *mdev_ch; @@ -759,7 +759,7 @@ static ssize_t remove_link_store(struct device_driver *drv, size_t len) { struct most_channel *c; - struct most_aim *aim; + struct core_component *aim; char buffer[STRING_SIZE]; char *mdev; char *mdev_ch; @@ -1039,7 +1039,7 @@ static void most_write_completion(struct mbo *mbo) arm_mbo(mbo); } -int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim) +int channel_has_mbo(struct most_interface *iface, int id, struct core_component *aim) { struct most_channel *c = iface->p->channel[id]; unsigned long flags; @@ -1069,7 +1069,7 @@ EXPORT_SYMBOL_GPL(channel_has_mbo); * Returns a pointer to MBO on success or NULL otherwise. */ struct mbo *most_get_mbo(struct most_interface *iface, int id, - struct most_aim *aim) + struct core_component *aim) { struct mbo *mbo; struct most_channel *c; @@ -1174,7 +1174,7 @@ static void most_read_completion(struct mbo *mbo) * Returns 0 on success or error code otherwise. */ int most_start_channel(struct most_interface *iface, int id, - struct most_aim *aim) + struct core_component *aim) { int num_buffer; int ret; @@ -1244,7 +1244,7 @@ EXPORT_SYMBOL_GPL(most_start_channel); * @id: channel ID */ int most_stop_channel(struct most_interface *iface, int id, - struct most_aim *aim) + struct core_component *aim) { struct most_channel *c; @@ -1302,7 +1302,7 @@ EXPORT_SYMBOL_GPL(most_stop_channel); * most_register_aim - registers an AIM (driver) with the core * @aim: instance of AIM to be registered */ -int most_register_aim(struct most_aim *aim) +int most_register_aim(struct core_component *aim) { if (!aim) { pr_err("Bad driver\n"); @@ -1318,7 +1318,7 @@ static int disconnect_channels(struct device *dev, void *data) { struct most_interface *iface; struct most_channel *c, *tmp; - struct most_aim *aim = data; + struct core_component *aim = data; iface = to_most_interface(dev); list_for_each_entry_safe(c, tmp, &iface->p->channel_list, list) { @@ -1336,7 +1336,7 @@ static int disconnect_channels(struct device *dev, void *data) * most_deregister_aim - deregisters an AIM (driver) with the core * @aim: AIM to be removed */ -int most_deregister_aim(struct most_aim *aim) +int most_deregister_aim(struct core_component *aim) { if (!aim) { pr_err("Bad driver\n"); diff --git a/drivers/staging/most/core.h b/drivers/staging/most/core.h index 718dab8b4b18..4b6e47e78ccf 100644 --- a/drivers/staging/most/core.h +++ b/drivers/staging/most/core.h @@ -263,7 +263,7 @@ struct most_interface { * @tx_completion: completion handler for transmitted packets * @context: context pointer to be used by mostcore */ -struct most_aim { +struct core_component { struct list_head list; const char *name; int (*probe_channel)(struct most_interface *iface, int channel_idx, @@ -274,8 +274,6 @@ struct most_aim { int (*tx_completion)(struct most_interface *iface, int channel_idx); }; -#define to_most_aim(d) container_of(d, struct most_aim, dev) - /** * most_register_interface - Registers instance of the interface. * @iface: Pointer to the interface instance description. @@ -310,16 +308,16 @@ void most_stop_enqueue(struct most_interface *iface, int channel_idx); * in wait fifo. */ void most_resume_enqueue(struct most_interface *iface, int channel_idx); -int most_register_aim(struct most_aim *aim); -int most_deregister_aim(struct most_aim *aim); +int most_register_aim(struct core_component *comp); +int most_deregister_aim(struct core_component *comp); struct mbo *most_get_mbo(struct most_interface *iface, int channel_idx, - struct most_aim *); + struct core_component *comp); void most_put_mbo(struct mbo *mbo); int channel_has_mbo(struct most_interface *iface, int channel_idx, - struct most_aim *aim); + struct core_component *comp); int most_start_channel(struct most_interface *iface, int channel_idx, - struct most_aim *); + struct core_component *comp); int most_stop_channel(struct most_interface *iface, int channel_idx, - struct most_aim *); + struct core_component *comp); #endif /* MOST_CORE_H_ */ diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c index a9323e4afad7..edc12ad4de61 100644 --- a/drivers/staging/most/net/net.c +++ b/drivers/staging/most/net/net.c @@ -68,7 +68,7 @@ struct net_dev_context { static struct list_head net_devices = LIST_HEAD_INIT(net_devices); static struct mutex probe_disc_mt; /* ch->linked = true, most_nd_open */ static struct spinlock list_lock; /* list_head, ch->linked = false, dev_hold */ -static struct most_aim aim; +static struct core_component aim; static int skb_to_mamac(const struct sk_buff *skb, struct mbo *mbo) { @@ -494,7 +494,7 @@ put_nd: return ret; } -static struct most_aim aim = { +static struct core_component aim = { .name = "net", .probe_channel = aim_probe_channel, .disconnect_channel = aim_disconnect_channel, diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c index 5504f93aca39..e605cbe57511 100644 --- a/drivers/staging/most/sound/sound.c +++ b/drivers/staging/most/sound/sound.c @@ -21,7 +21,7 @@ #define DRIVER_NAME "sound" static struct list_head dev_list; -static struct most_aim audio_aim; +static struct core_component audio_aim; /** * struct channel - private structure to keep channel specific data @@ -717,9 +717,9 @@ static int audio_tx_completion(struct most_interface *iface, int channel_id) } /** - * Initialization of the struct most_aim + * Initialization of the struct core_component */ -static struct most_aim audio_aim = { +static struct core_component audio_aim = { .name = DRIVER_NAME, .probe_channel = audio_probe_channel, .disconnect_channel = audio_disconnect_channel, diff --git a/drivers/staging/most/video/video.c b/drivers/staging/most/video/video.c index 25ae4887b04d..2b8b3aed1ec2 100644 --- a/drivers/staging/most/video/video.c +++ b/drivers/staging/most/video/video.c @@ -25,7 +25,7 @@ #define V4L2_AIM_MAX_INPUT 1 -static struct most_aim aim_info; +static struct core_component aim_info; struct most_video_dev { struct most_interface *iface; @@ -562,7 +562,7 @@ static int aim_disconnect_channel(struct most_interface *iface, return 0; } -static struct most_aim aim_info = { +static struct core_component aim_info = { .name = "v4l", .probe_channel = aim_probe_channel, .disconnect_channel = aim_disconnect_channel, -- cgit v1.2.3