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

staging: most: core: rename members aim* of struct most_channel

This patch renames the struct members "aim0" and "aim0" to "pipe0" and
"pipe1".  It is needed to have a conclusive nomenclature of the struct and
its instances.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ab868bad
...@@ -56,8 +56,8 @@ struct most_channel { ...@@ -56,8 +56,8 @@ struct most_channel {
spinlock_t fifo_lock; spinlock_t fifo_lock;
struct list_head halt_fifo; struct list_head halt_fifo;
struct list_head list; struct list_head list;
struct pipe aim0; struct pipe pipe0;
struct pipe aim1; struct pipe pipe1;
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;
...@@ -536,7 +536,7 @@ static ssize_t links_show(struct device *dev, struct device_attribute *attr, ...@@ -536,7 +536,7 @@ static ssize_t links_show(struct device *dev, struct device_attribute *attr,
list_for_each_entry(i, &instance_list, list) { list_for_each_entry(i, &instance_list, list) {
list_for_each_entry(c, &i->channel_list, list) { list_for_each_entry(c, &i->channel_list, list) {
if (c->aim0.aim == aim || c->aim1.aim == aim) { if (c->pipe0.aim == aim || c->pipe1.aim == aim) {
offs += snprintf(buf + offs, PAGE_SIZE - offs, offs += snprintf(buf + offs, PAGE_SIZE - offs,
"%s:%s\n", "%s:%s\n",
dev_name(&i->iface->dev), dev_name(&i->iface->dev),
...@@ -626,10 +626,10 @@ inline int link_channel_to_aim(struct most_channel *c, struct most_aim *aim, ...@@ -626,10 +626,10 @@ inline int link_channel_to_aim(struct most_channel *c, struct most_aim *aim,
int ret; int ret;
struct most_aim **aim_ptr; struct most_aim **aim_ptr;
if (!c->aim0.aim) if (!c->pipe0.aim)
aim_ptr = &c->aim0.aim; aim_ptr = &c->pipe0.aim;
else if (!c->aim1.aim) else if (!c->pipe1.aim)
aim_ptr = &c->aim1.aim; aim_ptr = &c->pipe1.aim;
else else
return -ENOSPC; return -ENOSPC;
...@@ -738,10 +738,10 @@ static ssize_t remove_link_store(struct device *dev, ...@@ -738,10 +738,10 @@ static ssize_t remove_link_store(struct device *dev,
if (aim->disconnect_channel(c->iface, c->channel_id)) if (aim->disconnect_channel(c->iface, c->channel_id))
return -EIO; return -EIO;
if (c->aim0.aim == aim) if (c->pipe0.aim == aim)
c->aim0.aim = NULL; c->pipe0.aim = NULL;
if (c->aim1.aim == aim) if (c->pipe1.aim == aim)
c->aim1.aim = NULL; c->pipe1.aim = NULL;
return len; return len;
} }
...@@ -910,11 +910,11 @@ static void arm_mbo(struct mbo *mbo) ...@@ -910,11 +910,11 @@ static void arm_mbo(struct mbo *mbo)
list_add_tail(&mbo->list, &c->fifo); list_add_tail(&mbo->list, &c->fifo);
spin_unlock_irqrestore(&c->fifo_lock, flags); spin_unlock_irqrestore(&c->fifo_lock, flags);
if (c->aim0.refs && c->aim0.aim->tx_completion) if (c->pipe0.refs && c->pipe0.aim->tx_completion)
c->aim0.aim->tx_completion(c->iface, c->channel_id); c->pipe0.aim->tx_completion(c->iface, c->channel_id);
if (c->aim1.refs && c->aim1.aim->tx_completion) if (c->pipe1.refs && c->pipe1.aim->tx_completion)
c->aim1.aim->tx_completion(c->iface, c->channel_id); c->pipe1.aim->tx_completion(c->iface, c->channel_id);
} }
/** /**
...@@ -1021,9 +1021,9 @@ int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim) ...@@ -1021,9 +1021,9 @@ int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim)
if (unlikely(!c)) if (unlikely(!c))
return -EINVAL; return -EINVAL;
if (c->aim0.refs && c->aim1.refs && if (c->pipe0.refs && c->pipe1.refs &&
((aim == c->aim0.aim && c->aim0.num_buffers <= 0) || ((aim == c->pipe0.aim && c->pipe0.num_buffers <= 0) ||
(aim == c->aim1.aim && c->aim1.num_buffers <= 0))) (aim == c->pipe1.aim && c->pipe1.num_buffers <= 0)))
return 0; return 0;
spin_lock_irqsave(&c->fifo_lock, flags); spin_lock_irqsave(&c->fifo_lock, flags);
...@@ -1054,15 +1054,15 @@ struct mbo *most_get_mbo(struct most_interface *iface, int id, ...@@ -1054,15 +1054,15 @@ struct mbo *most_get_mbo(struct most_interface *iface, int id,
if (unlikely(!c)) if (unlikely(!c))
return NULL; return NULL;
if (c->aim0.refs && c->aim1.refs && if (c->pipe0.refs && c->pipe1.refs &&
((aim == c->aim0.aim && c->aim0.num_buffers <= 0) || ((aim == c->pipe0.aim && c->pipe0.num_buffers <= 0) ||
(aim == c->aim1.aim && c->aim1.num_buffers <= 0))) (aim == c->pipe1.aim && c->pipe1.num_buffers <= 0)))
return NULL; return NULL;
if (aim == c->aim0.aim) if (aim == c->pipe0.aim)
num_buffers_ptr = &c->aim0.num_buffers; num_buffers_ptr = &c->pipe0.num_buffers;
else if (aim == c->aim1.aim) else if (aim == c->pipe1.aim)
num_buffers_ptr = &c->aim1.num_buffers; num_buffers_ptr = &c->pipe1.num_buffers;
else else
num_buffers_ptr = &dummy_num_buffers; num_buffers_ptr = &dummy_num_buffers;
...@@ -1126,12 +1126,12 @@ static void most_read_completion(struct mbo *mbo) ...@@ -1126,12 +1126,12 @@ static void most_read_completion(struct mbo *mbo)
if (atomic_sub_and_test(1, &c->mbo_nq_level)) if (atomic_sub_and_test(1, &c->mbo_nq_level))
c->is_starving = 1; c->is_starving = 1;
if (c->aim0.refs && c->aim0.aim->rx_completion && if (c->pipe0.refs && c->pipe0.aim->rx_completion &&
c->aim0.aim->rx_completion(mbo) == 0) c->pipe0.aim->rx_completion(mbo) == 0)
return; return;
if (c->aim1.refs && c->aim1.aim->rx_completion && if (c->pipe1.refs && c->pipe1.aim->rx_completion &&
c->aim1.aim->rx_completion(mbo) == 0) c->pipe1.aim->rx_completion(mbo) == 0)
return; return;
most_put_mbo(mbo); most_put_mbo(mbo);
...@@ -1159,7 +1159,7 @@ int most_start_channel(struct most_interface *iface, int id, ...@@ -1159,7 +1159,7 @@ int most_start_channel(struct most_interface *iface, int id,
return -EINVAL; return -EINVAL;
mutex_lock(&c->start_mutex); mutex_lock(&c->start_mutex);
if (c->aim0.refs + c->aim1.refs > 0) if (c->pipe0.refs + c->pipe1.refs > 0)
goto out; /* already started by other aim */ goto out; /* already started by other aim */
if (!try_module_get(iface->mod)) { if (!try_module_get(iface->mod)) {
...@@ -1194,15 +1194,15 @@ int most_start_channel(struct most_interface *iface, int id, ...@@ -1194,15 +1194,15 @@ int most_start_channel(struct most_interface *iface, int id,
goto error; goto error;
c->is_starving = 0; c->is_starving = 0;
c->aim0.num_buffers = c->cfg.num_buffers / 2; c->pipe0.num_buffers = c->cfg.num_buffers / 2;
c->aim1.num_buffers = c->cfg.num_buffers - c->aim0.num_buffers; c->pipe1.num_buffers = c->cfg.num_buffers - c->pipe0.num_buffers;
atomic_set(&c->mbo_ref, num_buffer); atomic_set(&c->mbo_ref, num_buffer);
out: out:
if (aim == c->aim0.aim) if (aim == c->pipe0.aim)
c->aim0.refs++; c->pipe0.refs++;
if (aim == c->aim1.aim) if (aim == c->pipe1.aim)
c->aim1.refs++; c->pipe1.refs++;
mutex_unlock(&c->start_mutex); mutex_unlock(&c->start_mutex);
return 0; return 0;
...@@ -1234,7 +1234,7 @@ int most_stop_channel(struct most_interface *iface, int id, ...@@ -1234,7 +1234,7 @@ int most_stop_channel(struct most_interface *iface, int id,
return -EINVAL; return -EINVAL;
mutex_lock(&c->start_mutex); mutex_lock(&c->start_mutex);
if (c->aim0.refs + c->aim1.refs >= 2) if (c->pipe0.refs + c->pipe1.refs >= 2)
goto out; goto out;
if (c->hdm_enqueue_task) if (c->hdm_enqueue_task)
...@@ -1266,10 +1266,10 @@ int most_stop_channel(struct most_interface *iface, int id, ...@@ -1266,10 +1266,10 @@ int most_stop_channel(struct most_interface *iface, int id,
c->is_poisoned = false; c->is_poisoned = false;
out: out:
if (aim == c->aim0.aim) if (aim == c->pipe0.aim)
c->aim0.refs--; c->pipe0.refs--;
if (aim == c->aim1.aim) if (aim == c->pipe1.aim)
c->aim1.refs--; c->pipe1.refs--;
mutex_unlock(&c->start_mutex); mutex_unlock(&c->start_mutex);
return 0; return 0;
} }
...@@ -1324,13 +1324,13 @@ int most_deregister_aim(struct most_aim *aim) ...@@ -1324,13 +1324,13 @@ int most_deregister_aim(struct most_aim *aim)
list_for_each_entry_safe(i, i_tmp, &instance_list, list) { list_for_each_entry_safe(i, i_tmp, &instance_list, list) {
list_for_each_entry_safe(c, tmp, &i->channel_list, list) { list_for_each_entry_safe(c, tmp, &i->channel_list, list) {
if (c->aim0.aim == aim || c->aim1.aim == aim) if (c->pipe0.aim == aim || c->pipe1.aim == aim)
aim->disconnect_channel( aim->disconnect_channel(
c->iface, c->channel_id); c->iface, c->channel_id);
if (c->aim0.aim == aim) if (c->pipe0.aim == aim)
c->aim0.aim = NULL; c->pipe0.aim = NULL;
if (c->aim1.aim == aim) if (c->pipe1.aim == aim)
c->aim1.aim = NULL; c->pipe1.aim = NULL;
} }
} }
device_unregister(&aim->dev); device_unregister(&aim->dev);
...@@ -1475,14 +1475,14 @@ void most_deregister_interface(struct most_interface *iface) ...@@ -1475,14 +1475,14 @@ void most_deregister_interface(struct most_interface *iface)
inst = iface->priv; inst = iface->priv;
for (i = 0; i < iface->num_channels; i++) { for (i = 0; i < iface->num_channels; i++) {
c = inst->channel[i]; c = inst->channel[i];
if (c->aim0.aim) if (c->pipe0.aim)
c->aim0.aim->disconnect_channel(c->iface, c->pipe0.aim->disconnect_channel(c->iface,
c->channel_id); c->channel_id);
if (c->aim1.aim) if (c->pipe1.aim)
c->aim1.aim->disconnect_channel(c->iface, c->pipe1.aim->disconnect_channel(c->iface,
c->channel_id); c->channel_id);
c->aim0.aim = NULL; c->pipe0.aim = NULL;
c->aim1.aim = NULL; c->pipe1.aim = NULL;
list_del(&c->list); list_del(&c->list);
device_unregister(&c->dev); device_unregister(&c->dev);
kfree(c); kfree(c);
......
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