From patchwork Thu Sep 1 22:27:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9309931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4434360756 for ; Thu, 1 Sep 2016 22:30:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04498293DE for ; Thu, 1 Sep 2016 22:30:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED36329547; Thu, 1 Sep 2016 22:30:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9EAA6293DE for ; Thu, 1 Sep 2016 22:30:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfaTx-0002kn-DA; Thu, 01 Sep 2016 22:29:13 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfaTM-0002De-54 for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2016 22:28:37 +0000 Received: by mail-pa0-x230.google.com with SMTP id cy9so33876068pac.0 for ; Thu, 01 Sep 2016 15:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qkI9fLzmQ4Ko2+j44qVqUslaoIJJEk0fnTlLp/tLhkA=; b=ZObgJwmjWEXzs5ljpilGY9fMlc8zxJnzXMsuaMbkT69C3dB/LE2iJnkcrQOWL9buTF frAEnc5p6q11ndoj6WiBxxAdKFklb2Ux3RdMtovXzO0r3apIeRIb6I2RzVZQEc4QQty/ AwaH3sVTnnCE/xJzNTv+KL6BsJzzNZ2bbTliE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qkI9fLzmQ4Ko2+j44qVqUslaoIJJEk0fnTlLp/tLhkA=; b=HPLoAJUpPyxI5tth7A3L5MPwLEc76yNZwazZ1sthl/mH1uhlH63cUhWJyNf6x1l6TJ 5cHiVeI1VDGLuUtOhKejMwkZzKrHnlO8VwA0kT0GAJZPvROnfcv+QTh4lsOukNqEPIpX XOp0u/TnBAl0jGiUHwmxCMbbR98RwPChNVvwq84YXnnH8f0aklSLuoHp1ejPE3SgwoBt Vj4asragSLNiaGCbHAmNMK2+cmYLespTLDliXtMxroNpF1QBAhyzWIj737XU8Rbiq5mw YWKshTwlmYVgBFlw1i3mQLxjt9WQfZHbrJkGx/DqhVryJWWg3zsYKjt3x7/OYVBaefgM yoTA== X-Gm-Message-State: AE9vXwNaF6/s5G1YENS9DWRijUoqnqSmbsEgotSlIr3vBSaxrdk9pE6n2bDEFB9xOujrvQvh X-Received: by 10.66.50.199 with SMTP id e7mr31330510pao.58.1472768894843; Thu, 01 Sep 2016 15:28:14 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id iw10sm8887131pac.14.2016.09.01.15.28.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 15:28:14 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Subject: [PATCH v2 02/17] rpmsg: Name rpmsg devices based on channel id Date: Thu, 1 Sep 2016 15:27:54 -0700 Message-Id: <1472768889-3906-3-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> References: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160901_152836_303017_C5F208C4 X-CRM114-Status: GOOD ( 12.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP By basing rpmsg device names on channel id we end up with human readable device names in sysfs and debug logs. Signed-off-by: Bjorn Andersson Reviewed-by: Sarangdhar Joshi --- Changes since v1: - None drivers/rpmsg/virtio_rpmsg_bus.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 495fa0a282d3..c4bd89ea7681 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -136,14 +136,6 @@ rpmsg_show_attr(src, src, "0x%x\n"); rpmsg_show_attr(dst, dst, "0x%x\n"); rpmsg_show_attr(announce, announce ? "true" : "false", "%s\n"); -/* - * Unique (and free running) index for rpmsg devices. - * - * Yeah, we're not recycling those numbers (yet?). will be easy - * to change if/when we want to. - */ -static unsigned int rpmsg_dev_index; - static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -531,8 +523,8 @@ static struct rpmsg_channel *rpmsg_create_channel(struct virtproc_info *vrp, strncpy(rpdev->id.name, chinfo->name, RPMSG_NAME_SIZE); - /* very simple device indexing plumbing which is enough for now */ - dev_set_name(&rpdev->dev, "rpmsg%d", rpmsg_dev_index++); + dev_set_name(&rpdev->dev, "%s:%s", + dev_name(dev->parent), rpdev->id.name); rpdev->dev.parent = &vrp->vdev->dev; rpdev->dev.bus = &rpmsg_bus;