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: 75251 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp536832qga; Thu, 1 Sep 2016 15:30:22 -0700 (PDT) X-Received: by 10.66.139.110 with SMTP id qx14mr31356442pab.101.1472769022774; Thu, 01 Sep 2016 15:30:22 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id m63si7697299pfb.137.2016.09.01.15.30.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 15:30:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:230 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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+patch=linaro.org@lists.infradead.org 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 --- Changes since v1: - None drivers/rpmsg/virtio_rpmsg_bus.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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;