Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp250544ybk; Tue, 12 May 2020 22:13:16 -0700 (PDT) X-Google-Smtp-Source: APiQypJpwQ77Dgy9fU2Wy/dRnAhpHe3x55nbRjeK0+ReE4vpVQrAnoUyHcO4N35XOF12My/E5pmB X-Received: by 2002:a05:6402:2076:: with SMTP id bd22mr21186022edb.334.1589346796463; Tue, 12 May 2020 22:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589346796; cv=none; d=google.com; s=arc-20160816; b=XrvMobWhuGBrJBnOFhCjdasuiTi0fn7lO0ef9oJqynjxBlIVbqdT399cVztrHKfVWh UJ05lRcF/q2lqQH2/qpMNJyxBK7AzmNpQIg7RkEJQgnwavBckOItlXUJhC3itquMVHoP ltDMThwN6cQyGFfPsODeDnPx2jOLDgWSjgfq0wOClTF/UAOTHcRtqcEJZlE3xnkDTK5B HumEOAZLZ5YURS88Fe0COzXI284hTLPzGBEBbO7EQAi31K6OR5hzpX89NJPpkVBxub2U 8M2j8og/8oJcvArGO6PkP1s41MhBJKDcVUxmf0fsL7DvLnBFU4cw6RwMj0hb3Ek6GQ79 uj1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=dvAdHupHVhZAfDEUXPOrtucMmBZsI35VquyElsXVMNs=; b=SCMdmBida+C9RxDBhuuueashda/lRkgrqYkfoV9ruNGcb7il5m8yL0GuELHmT1nP0L FA1p6xEj6T8dBdI5FawCPDw0UOO61gNi6kdazP2vbQURNexNH4j6U0yGVayxJcCq7lyL ONGhkQntjH367AfKUomA7kvN9z1h1AXFHdiMWgQOw3X4nvfabNGBVLqjPotxR1aj8FjB NfYBr4pSIeQfsDyJ4e+R9uBIrIEJeGUain5B0quyfgLopCPdgBUqWHbJ1da2OYTsDFYU A057EXgkgOQQMvmPG0rkzHCdGkX/VL4CXKY98W9dyYmLDzNTbbGuNEnIDBWm3erXAH/M iHPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cCxT+Nee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r16si1275489edp.57.2020.05.12.22.12.54; Tue, 12 May 2020 22:13:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cCxT+Nee; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728958AbgEMFKs (ORCPT + 99 others); Wed, 13 May 2020 01:10:48 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:37603 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728891AbgEMFKr (ORCPT ); Wed, 13 May 2020 01:10:47 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1589346646; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=dvAdHupHVhZAfDEUXPOrtucMmBZsI35VquyElsXVMNs=; b=cCxT+NeecDaKXSp6kjR0Os/cJ8s3NRTy7YYyKonNqAfZKzZxLk0J4T3J3soYWGeaUPb8xAPn WqUFT70+9yduWVL7uHNsyo157bK6pEfq2zMXXoeY882fzdfOiDid3kAK0bk4o5GvFTqWrtdX ZmuYFVK7uIpG54bCMKr05rZbmj8= X-Mailgun-Sending-Ip: 104.130.122.27 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5ebb814d.7fc768b8b880-smtp-out-n03; Wed, 13 May 2020 05:10:37 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3244DC4478F; Wed, 13 May 2020 05:10:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7C018C43637; Wed, 13 May 2020 05:10:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7C018C43637 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, sricharan@codeaurora.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam , Andy Gross , linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM SUPPORT) Subject: [PATCH V5 4/5] rpmsg: glink: Expose rpmsg name attr for glink Date: Wed, 13 May 2020 10:40:05 +0530 Message-Id: <1589346606-15046-5-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589346606-15046-1-git-send-email-aneela@codeaurora.org> References: <1589346606-15046-1-git-send-email-aneela@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Lew Expose the name field as an attr so clients listening to uevents for rpmsg can identify the edge the events correspond to. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/qcom_glink_native.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 3a7f87c..0e8a28c0 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -1574,6 +1574,26 @@ static void qcom_glink_cancel_rx_work(struct qcom_glink *glink) kfree(dcmd); } +static ssize_t rpmsg_name_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int ret = 0; + const char *name; + + ret = of_property_read_string(dev->of_node, "label", &name); + if (ret < 0) + name = dev->of_node->name; + + return snprintf(buf, RPMSG_NAME_SIZE, "%s\n", name); +} +static DEVICE_ATTR_RO(rpmsg_name); + +static struct attribute *qcom_glink_attrs[] = { + &dev_attr_rpmsg_name.attr, + NULL +}; +ATTRIBUTE_GROUPS(qcom_glink); + static void qcom_glink_device_release(struct device *dev) { struct rpmsg_device *rpdev = to_rpmsg_device(dev); @@ -1638,6 +1658,12 @@ struct qcom_glink *qcom_glink_native_probe(struct device *dev, idr_init(&glink->lcids); idr_init(&glink->rcids); + glink->dev->groups = qcom_glink_groups; + + ret = device_add_groups(dev, qcom_glink_groups); + if (ret) + dev_err(dev, "failed to add groups\n"); + ret = of_property_read_string(dev->of_node, "label", &glink->name); if (ret < 0) glink->name = dev->of_node->name; -- 2.7.4