linux-stable/drivers/rpmsg
Arnaud Pouliquen 964e8bedd5 rpmsg: char: Return an error if device already open
The rpmsg_create_ept function is invoked when the device is opened.
As only one endpoint must be created per device. It is not possible to
open the same device twice. But there is nothing to prevent multi open.
Return -EBUSY when device is already opened to have a generic error
instead of relying on the back-end to potentially detect the error.

Without this patch for instance the GLINK driver return -EBUSY while
the virtio bus return -ENOSPC.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Link: https://lore.kernel.org/r/20210311140413.31725-7-arnaud.pouliquen@foss.st.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2021-03-17 14:16:58 -05:00
..
Kconfig rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
Makefile rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
mtk_rpmsg.c rpmsg: Avoid double-free in mtk_rpmsg_register_device 2020-09-15 03:43:24 +00:00
qcom_glink_native.c rpmsg: char: Use rpmsg_sendto to specify the message destination address 2021-03-17 14:16:36 -05:00
qcom_glink_native.h rpmsg: glink: Switch to SPDX license identifier 2018-06-03 17:37:15 -07:00
qcom_glink_rpm.c rpmsg: glink: Switch to SPDX license identifier 2018-06-03 17:37:15 -07:00
qcom_glink_smem.c rpmsg: glink: Set tail pointer to 0 at end of FIFO 2019-10-11 11:34:12 -07:00
qcom_glink_ssr.c rpmsg: glink: add include of header file 2021-01-05 22:22:40 -06:00
qcom_smd.c rpmsg: char: Use rpmsg_sendto to specify the message destination address 2021-03-17 14:16:36 -05:00
rpmsg_char.c rpmsg: char: Return an error if device already open 2021-03-17 14:16:58 -05:00
rpmsg_core.c rpmsg: core: Add channel creation internal API 2020-11-24 10:11:35 -06:00
rpmsg_internal.h rpmsg: Make rpmsg_{register|unregister}_device() public 2020-11-24 10:11:52 -06:00
rpmsg_ns.c rpmsg: Turn name service into a stand alone driver 2020-11-24 10:11:59 -06:00
virtio_rpmsg_bus.c rpmsg: virtio: Register the rpmsg_char device 2021-03-17 14:16:47 -05:00