From patchwork Tue Aug 16 00:17:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9282395 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 B07CA600CB for ; Tue, 16 Aug 2016 00:19:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A109F28DCB for ; Tue, 16 Aug 2016 00:19:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9569228E8E; Tue, 16 Aug 2016 00:19:44 +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 2B48F28DCB for ; Tue, 16 Aug 2016 00:19:44 +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 1bZS5K-0003kx-2K; Tue, 16 Aug 2016 00:18:26 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZS4g-0003Q8-K9 for linux-arm-kernel@lists.infradead.org; Tue, 16 Aug 2016 00:17:49 +0000 Received: by mail-pa0-x22c.google.com with SMTP id fi15so20416569pac.1 for ; Mon, 15 Aug 2016 17:17:26 -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=LA3is9G5QyGXKSslNJpgG/rF0F/cNw3ol9eNFaoo+54=; b=DAVwXl+g+KVVoODWqGvovXbIJLSkR8xyvPoK3dbCt+EosuOyMnIkHPtO1fzW6g71/m OSYGOaXuZ1T24r25E2cnkGvpazTa3QoILhaNEHO1lFL5CT1MvFhNs0ePjRt2Z6ZnB3zr kXOfX5g9dhXRisBB543Lmmcs19Cl/2k+QE+aU= 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=LA3is9G5QyGXKSslNJpgG/rF0F/cNw3ol9eNFaoo+54=; b=MNMihyOSdS90i870lcnYYB+fbkBwZ6+wJdQ2zrshNKQICSa87UDKWInqnyoaEC+T09 Apw/umTx0Nil7Qi7TNlYMRpSvFlXs5A1XaYaktjwUxozUpjfmtMVA+iGhXz21WwXipY4 OYwAeQba687b7LTcDHY2SqQuKtLLBIJNd71n3JZ62YUURG011b0zf8M5diUzozOjo0ha g7L82bYyhJeuprjywuFd9IROJGZarZ9J/hvYfOmLUgkVkh+bvYqX1Si6lwGhyNEVRNQf W4vIXJErmmBQL+NT786Eg+JWhUePJAzaJZR9nlTtEEF1PMLUT9rxGsliTLbVRt/OGHNE OxEg== X-Gm-Message-State: AEkoouvUpHkPBvkcKI3cs03A5mKmHLUdHSR61UvOZvTTRHbYZ54W92YbsnS7QkBZhmj63hTX X-Received: by 10.66.170.44 with SMTP id aj12mr58964645pac.131.1471306645636; Mon, 15 Aug 2016 17:17:25 -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 p187sm34047931pfb.5.2016.08.15.17.17.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Aug 2016 17:17:25 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Subject: [PATCH 02/14] rpmsg: Name rpmsg devices based on channel id Date: Mon, 15 Aug 2016 17:17:08 -0700 Message-Id: <1471306640-29917-3-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1471306640-29917-1-git-send-email-bjorn.andersson@linaro.org> References: <1471306640-29917-1-git-send-email-bjorn.andersson@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160815_171746_916408_2388633C X-CRM114-Status: GOOD ( 10.79 ) 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 --- 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;