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;
|
||||
|
||||
rpmsg_port_queue_add_buffer(&port->txq, hdr);
|
||||
if (port->ops->notify_tx_ready)
|
||||
{
|
||||
port->ops->notify_tx_ready(port);
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
@ -340,9 +343,12 @@ static void rpmsg_port_release_rx_buffer(FAR struct rpmsg_device *rdev,
|
|||
if ((reserved & RPMSG_BUF_HELD_MASK) == (1 << RPMSG_BUF_HELD_SHIFT))
|
||||
{
|
||||
rpmsg_port_queue_return_buffer(&port->rxq, hdr);
|
||||
if (port->ops->notify_rx_free)
|
||||
{
|
||||
port->ops->notify_rx_free(port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: rpmsg_port_release_tx_buffer
|
||||
|
|
Loading…
Reference in New Issue