Skip to content

Commit 4dffed5

Browse files
committed
rpmsg: Name rpmsg devices based on channel id
By basing rpmsg device names on channel id we end up with human readable device names in sysfs and debug logs. Reviewed-by: Sarangdhar Joshi <spjoshi@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent a16644c commit 4dffed5

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

‎drivers/rpmsg/virtio_rpmsg_bus.c‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,6 @@ rpmsg_show_attr(src, src, "0x%x\n");
136136
rpmsg_show_attr(dst, dst, "0x%x\n");
137137
rpmsg_show_attr(announce, announce ? "true" : "false", "%s\n");
138138

139-
/*
140-
* Unique (and free running) index for rpmsg devices.
141-
*
142-
* Yeah, we're not recycling those numbers (yet?). will be easy
143-
* to change if/when we want to.
144-
*/
145-
static unsigned int rpmsg_dev_index;
146-
147139
static ssize_t modalias_show(struct device *dev,
148140
struct device_attribute *attr, char *buf)
149141
{
@@ -531,8 +523,8 @@ static struct rpmsg_channel *rpmsg_create_channel(struct virtproc_info *vrp,
531523

532524
strncpy(rpdev->id.name, chinfo->name, RPMSG_NAME_SIZE);
533525

534-
/* very simple device indexing plumbing which is enough for now */
535-
dev_set_name(&rpdev->dev, "rpmsg%d", rpmsg_dev_index++);
526+
dev_set_name(&rpdev->dev, "%s:%s",
527+
dev_name(dev->parent), rpdev->id.name);
536528

537529
rpdev->dev.parent = &vrp->vdev->dev;
538530
rpdev->dev.bus = &rpmsg_bus;

0 commit comments

Comments
 (0)