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: 9310029 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 6F56B60756 for ; Thu, 1 Sep 2016 22:35:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29B402955E for ; Thu, 1 Sep 2016 22:35:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DD7929562; Thu, 1 Sep 2016 22:35:40 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EDA02955E for ; Thu, 1 Sep 2016 22:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751652AbcIAWfO (ORCPT ); Thu, 1 Sep 2016 18:35:14 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:32880 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751594AbcIAW2P (ORCPT ); Thu, 1 Sep 2016 18:28:15 -0400 Received: by mail-pa0-f45.google.com with SMTP id cy9so33876066pac.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=RvgMkMN5AShAy9DTA/wj8Edg0NIl1NlazTLrupDtQfGQitsAA7478yVxeb8s8I0APW JLlO4Bgksxqw9oVpix75W7KfWBf433ONmjPo1ulEVQGoUc+Vj3ALm2Qh02QCfk3toCOC c4aY9pmUZ3yC/hk+uRS6TBOpNzTUUS+DRfDq7bPkAVg5lEMX+TNAATjvCeX7PBAanjr7 Xxe1qwrqObgTOdJ6NH3si343FgFPJufjuJBbhah3SCTV7ZBByg+U1z9vFt3/aCpfHnKF xhf9Pyf8zqVfzFR8Tu8rxLvLgARO0OuZs2zd4GXYkZmcMEqAnEPVFHKDvcIQXtEHpll6 w2Fw== X-Gm-Message-State: AE9vXwPbWhUDfOkU/IdQJZ7+KDH7JBz5OToTpBOCyjvcFXvwMPGagPQ3x5Her/tpgR0F11vS 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 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 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> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.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;