From patchwork Fri Dec 2 01:06:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9457567 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 49D876074E for ; Fri, 2 Dec 2016 01:06:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EFD428387 for ; Fri, 2 Dec 2016 01:06:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 209882850E; Fri, 2 Dec 2016 01:06:20 +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 A3FBC28387 for ; Fri, 2 Dec 2016 01:06:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755401AbcLBBGS (ORCPT ); Thu, 1 Dec 2016 20:06:18 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:36375 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751606AbcLBBGR (ORCPT ); Thu, 1 Dec 2016 20:06:17 -0500 Received: by mail-pg0-f50.google.com with SMTP id f188so100555793pgc.3 for ; Thu, 01 Dec 2016 17:06:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=9eDYzxqi1ehUXxuf+mt//sjnKIMIUHdq8/Wy+s3ihVI=; b=YZ0qDxvR1F6XBaKQ5YaYT+6mSfPm8c0+4fcTdopEj7JyokD+op98HsCvd7C+bKfiKm 70GlYPtF90NT+qDCQwqUp7ZQMtuVxYxT/BXJDfyg0++FhIJCmxoisdtygdTTzJS96ji+ iS7KF3xB63Yc+tF98gQX7AkZaM9xad1vj8Tcc= 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; bh=9eDYzxqi1ehUXxuf+mt//sjnKIMIUHdq8/Wy+s3ihVI=; b=Vqrxn5WuIRc8kvAaPMM8j9xCrhaATr7ba6GrG4a93QtA+WtCK1U16JSU1Y0JmbqwCE 1oSlUqITLB45DnPTxwKv+FhtmTXQ1yWll3zyX3jUX26dfjZjcX7r6DpmsulEbNhYvP7s 5P61vQue9nAECThJjBGVeRXOE5ffNOWk6MUl1eV7xRONNDbz6gfZZJZM/WHO1MgavfvR KmzH3Zl4crcLZxrG9gdIzHSDu13iki+xIb8JV9s1jyM7IqSMqxioOUXUBq/vpC2KAbVk 9RHJNKWdEYLYRODcwBdb1VxzpbcABtQW+9za+8OdvNZIQEyviLxq3vhONOp2kIxrNCDM oFNA== X-Gm-Message-State: AKaTC02KD9ThM0eF99U3dZwz5QVMh+O8MXIOd+ghDWqbRnrDB3LU8g/136ze5J/Rlaj6NmcD X-Received: by 10.99.127.16 with SMTP id a16mr45943107pgd.60.1480640777167; Thu, 01 Dec 2016 17:06:17 -0800 (PST) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id y89sm2677738pfk.83.2016.12.01.17.06.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Dec 2016 17:06:15 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH] rpmsg: qcom_smd: Add support for "label" property Date: Thu, 1 Dec 2016 17:06:14 -0800 Message-Id: <1480640774-20278-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 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 Add support for the "label" property, used to give the edge a name other than the one of the DT node. This allows the implementor to provide consistently named edges when using the rpmsg character device. Signed-off-by: Bjorn Andersson --- drivers/rpmsg/qcom_smd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c index 5549cd7fc2ef..7552ef0e82ba 100644 --- a/drivers/rpmsg/qcom_smd.c +++ b/drivers/rpmsg/qcom_smd.c @@ -117,6 +117,8 @@ static const struct { struct qcom_smd_edge { struct device dev; + const char *name; + struct device_node *of_node; unsigned edge_id; unsigned remote_pid; @@ -1278,6 +1280,10 @@ static int qcom_smd_parse_edge(struct device *dev, return -EINVAL; } + ret = of_property_read_string(node, "label", &edge->name); + if (ret < 0) + edge->name = node->name; + irq = irq_of_parse_and_map(node, 0); if (irq < 0) { dev_err(dev, "required smd interrupt missing\n"); @@ -1320,7 +1326,7 @@ static ssize_t rpmsg_name_show(struct device *dev, { struct qcom_smd_edge *edge = to_smd_edge(dev); - return sprintf(buf, "%s\n", edge->of_node->name); + return sprintf(buf, "%s\n", edge->name); } static DEVICE_ATTR_RO(rpmsg_name);