rpmsg/rpmsg_port: judge notify_rx_free and notify_tx_ready before calling
Some lower layers do not need implement these two operations, so judge them before calling. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
d27a9c516f
commit
a662c7aab3
@ -281,7 +281,10 @@ static int rpmsg_port_send_offchannel_nocopy(FAR struct rpmsg_device *rdev,
|
|||||||
sizeof(struct rpmsg_hdr) + len;
|
sizeof(struct rpmsg_hdr) + len;
|
||||||
|
|
||||||
rpmsg_port_queue_add_buffer(&port->txq, hdr);
|
rpmsg_port_queue_add_buffer(&port->txq, hdr);
|
||||||
port->ops->notify_tx_ready(port);
|
if (port->ops->notify_tx_ready)
|
||||||
|
{
|
||||||
|
port->ops->notify_tx_ready(port);
|
||||||
|
}
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
@ -340,7 +343,10 @@ static void rpmsg_port_release_rx_buffer(FAR struct rpmsg_device *rdev,
|
|||||||
if ((reserved & RPMSG_BUF_HELD_MASK) == (1 << RPMSG_BUF_HELD_SHIFT))
|
if ((reserved & RPMSG_BUF_HELD_MASK) == (1 << RPMSG_BUF_HELD_SHIFT))
|
||||||
{
|
{
|
||||||
rpmsg_port_queue_return_buffer(&port->rxq, hdr);
|
rpmsg_port_queue_return_buffer(&port->rxq, hdr);
|
||||||
port->ops->notify_rx_free(port);
|
if (port->ops->notify_rx_free)
|
||||||
|
{
|
||||||
|
port->ops->notify_rx_free(port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user