arm_mbo(mbo);
}
-/**
- * get_channel_by_iface - get pointer to channel object
- * @iface: pointer to interface instance
- * @id: channel ID
- *
- * This retrieves a pointer to a channel of the given interface and channel ID.
- */
-static struct
-most_c_obj *get_channel_by_iface(struct most_interface *iface, int id)
-{
- struct most_inst_obj *i;
-
- if (unlikely(!iface)) {
- pr_err("Bad interface\n");
- return NULL;
- }
- if (unlikely((id < 0) || (id >= iface->num_channels))) {
- pr_err("Channel index (%d) out of range\n", id);
- return NULL;
- }
- i = iface->priv;
- if (unlikely(!i)) {
- pr_err("interface is not registered\n");
- return NULL;
- }
- return i->channel[id];
-}
-
int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim)
{
- struct most_c_obj *c = get_channel_by_iface(iface, id);
+ struct most_inst_obj *inst = iface->priv;
+ struct most_c_obj *c = inst->channel[id];
unsigned long flags;
int empty;
{
struct mbo *mbo;
struct most_c_obj *c;
+ struct most_inst_obj *inst = iface->priv;
unsigned long flags;
int *num_buffers_ptr;
- c = get_channel_by_iface(iface, id);
+ c = inst->channel[id];
if (unlikely(!c))
return NULL;
{
int num_buffer;
int ret;
- struct most_c_obj *c = get_channel_by_iface(iface, id);
+ struct most_inst_obj *inst = iface->priv;
+ struct most_c_obj *c = inst->channel[id];
if (unlikely(!c))
return -EINVAL;
int most_stop_channel(struct most_interface *iface, int id,
struct most_aim *aim)
{
+ struct most_inst_obj *inst;
struct most_c_obj *c;
if (unlikely((!iface) || (id >= iface->num_channels) || (id < 0))) {
pr_err("Bad interface or index out of range\n");
return -EINVAL;
}
- c = get_channel_by_iface(iface, id);
+ inst = iface->priv;
+ c = inst->channel[id];
if (unlikely(!c))
return -EINVAL;
*/
void most_stop_enqueue(struct most_interface *iface, int id)
{
- struct most_c_obj *c = get_channel_by_iface(iface, id);
+ struct most_inst_obj *inst = iface->priv;
+ struct most_c_obj *c = inst->channel[id];
if (!c)
return;
*/
void most_resume_enqueue(struct most_interface *iface, int id)
{
- struct most_c_obj *c = get_channel_by_iface(iface, id);
+ struct most_inst_obj *inst = iface->priv;
+ struct most_c_obj *c = inst->channel[id];
if (!c)
return;