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: 73937 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp1711822qga; Mon, 15 Aug 2016 17:17:51 -0700 (PDT) X-Received: by 10.66.123.42 with SMTP id lx10mr1071116pab.95.1471306671800; Mon, 15 Aug 2016 17:17:51 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 77si28990605pft.11.2016.08.15.17.17.47; Mon, 15 Aug 2016 17:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208AbcHPARa (ORCPT + 27 others); Mon, 15 Aug 2016 20:17:30 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:32781 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752409AbcHPAR0 (ORCPT ); Mon, 15 Aug 2016 20:17:26 -0400 Received: by mail-pa0-f41.google.com with SMTP id ti13so20415427pac.0 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=EU+j9OBUz9/YV/yQxcIJbf2/wWyhBTr9vpdIRt51Ou9lLD20EEtUtr4tsyKsxRs6DI JbYVuEulXeTw5Xzd7HpPaR9LoM04MwWmxgJwLq58cz6WQhXCgjAmhEozQ8Ue0pTy6VDa PLl1Usqmpp8/dRvai6/S80LOLbdvQNZEnSLIa6clZ6wJNq/uisA6mABDmg07D3JEFBCF Xi1Y17n650VdndsZkJ6HVK9ZTc81U10GEpxXWCcV9AP6X+7eyLTx9IHh3FNRGBhlPB5J WF9i7mMKl20REF21XIoulHL9C0SqmXb+5FRM7dRzM9TykatIn6LApzeaWHSSSanYIRHH 1MdA== X-Gm-Message-State: AEkoouu1MjFbJAjx6Mh/PD9w2TfaNzHRJ3f+2v9NXewyvrUMfhPJV2VA0XkeFdc0gQziQjer 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 Cc: linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/rpmsg/virtio_rpmsg_bus.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) -- 2.5.0 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;