OSDN Git Service

rpmsg: virtio_rpmsg_bus: fix channel creation
authorLoic Pallardy <loic.pallardy@st.com>
Thu, 15 Dec 2016 14:49:56 +0000 (15:49 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 30 Dec 2016 11:12:11 +0000 (03:12 -0800)
commit63447646ac657fde00bb658ce21a3431940ae0ad
tree42c99d0259b8204a058e96f5ce172031798064f0
parent7ce7d89f48834cefece7804d38fc5d85382edf77
rpmsg: virtio_rpmsg_bus: fix channel creation

Since commit 4dffed5b3ac796b ("rpmsg: Name rpmsg devices based on
channel id"), it is no more possible for a firmware to register twice
a service (on different endpoints). rpmsg_register_device function
is failing when calling device_add for the second time as second
device has the same name as first one already register.
It is because name is based only on service name and so is not more
unique. Previously name was unique thanks to the use of rpmsg_dev_index.

This patch adds destination and source endpoint numbers device name to
create an unique identifier.

Fixes: 4dffed5b3ac7 ("rpmsg: Name rpmsg devices based on channel id")
Acked-by: Peter Griffin <peter.griffin@linaro.org>
Signed-off-by: Loic Pallardy <loic.pallardy@st.com>
[bjorn: flipped name and address in device name]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/rpmsg/rpmsg_core.c