From patchwork Mon Jun 15 21:38:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11605955 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4765E912 for ; Mon, 15 Jun 2020 21:39:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D9C8207D3 for ; Mon, 15 Jun 2020 21:39:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="icMWvMbi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726349AbgFOVjE (ORCPT ); Mon, 15 Jun 2020 17:39:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgFOVjD (ORCPT ); Mon, 15 Jun 2020 17:39:03 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DD7BC061A0E for ; Mon, 15 Jun 2020 14:39:02 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id m2so478884pjv.2 for ; Mon, 15 Jun 2020 14:39:02 -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 :mime-version:content-transfer-encoding; bh=gyRhxXlSJbKSK/jr6YPy3HeQq4PdeBC9vguPA+3WUyI=; b=icMWvMbiSqJrPnrfYMv+Lor6G9QXAlC+u0lRJ44xpWskpBzTEY00E0jUphWPJ5513Y NCXchGnjLxzZwwOJXmqNJu1TKuw4t0DStYw7E4YsN1g/5J/slaY5u2DEcAgewtRhNpxw g/DMruG14/zk7/0U2NfZmfiAMIpwG7waTSMPM49Lyz5t8kSXecTDGoNhkwxw5vftqjO9 pU2JgL2stBOrzNjqku/4WPz4ZPwiNFYI2jaMXtOLkALq27JXYzpc3h9KH8WMzVdAw7t5 8jZqmUD9azVQEkY/sqScFT8a+DQLerE2Fp/J0RFHVfEahfYkD/oGJjJ5bLVedumUtlbN QFJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gyRhxXlSJbKSK/jr6YPy3HeQq4PdeBC9vguPA+3WUyI=; b=KBqNfTERKgdz3PQ8AJd32xxNI4Wkvhz9ICjeTCtaWQL0yZQkkUjyYcTn3/6xfkfp3k aWxVwnjIPfFDc5DHgRBFIDU3Z/rb0q/w2LNM+eSVpY03Vvxwlhh8S6fIE/rPpIJiQIcf QzYE0FrloY2/fSEn5JNU1clvpU1oPvHQP6J2xW8UWO97yqgf4PEi7xEjbzQluDutV9B+ 22PyGWUsTmIIY7vinM5nsia/6lvBEOZ0cDnmFKU6sNIarufsWlH4xQdaVBwZHEKliI/q oX2JCTnOEdQklqWum/OuHi+TlFSdRgGaTfT22uBdwknmljBQBvTrnHJ2vR7Dqnw/5Mlx seiw== X-Gm-Message-State: AOAM530pASrqKyJJc+818M+1klnINmI25JcVPxSjj6ibKPUcjBzGNVWX VlfU+NTtwMnnIXKW4YBI0EKzOQ== X-Google-Smtp-Source: ABdhPJznJNn8sjKPbAHG0ZIgIQ+QDCC5XbXar3eahwar9jK6C6gr2OXePVVMNhzbCs+V8JhHfEpLNA== X-Received: by 2002:a17:90a:d803:: with SMTP id a3mr1263993pjv.125.1592257142004; Mon, 15 Jun 2020 14:39:02 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o186sm8708227pgo.65.2020.06.15.14.39.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 14:39:01 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 1/3] rpmsg: core: Add wildcard match for name service Date: Mon, 15 Jun 2020 15:38:57 -0600 Message-Id: <20200615213859.443152-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200615213859.443152-1-mathieu.poirier@linaro.org> References: <20200615213859.443152-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Adding the capability to supplement the base definition published by an rpmsg_driver with a postfix description so that it is possible for several entity to use the same service. Signed-off-by: Mathieu Poirier Acked-by: Arnaud Pouliquen Acked-by: Suman Anna --- drivers/rpmsg/rpmsg_core.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index a6361cad608b..5e01e8dede6b 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -399,7 +399,25 @@ ATTRIBUTE_GROUPS(rpmsg_dev); static inline int rpmsg_id_match(const struct rpmsg_device *rpdev, const struct rpmsg_device_id *id) { - return strncmp(id->name, rpdev->id.name, RPMSG_NAME_SIZE) == 0; + size_t len = min_t(size_t, strlen(id->name), RPMSG_NAME_SIZE); + + /* + * Allow for wildcard matches. For example if rpmsg_driver::id_table + * is: + * + * static struct rpmsg_device_id rpmsg_driver_sample_id_table[] = { + * { .name = "rpmsg-client-sample" }, + * { }, + * } + * + * Then it is possible to support "rpmsg-client-sample*", i.e: + * rpmsg-client-sample + * rpmsg-client-sample_instance0 + * rpmsg-client-sample_instance1 + * ... + * rpmsg-client-sample_instanceX + */ + return strncmp(id->name, rpdev->id.name, len) == 0; } /* match rpmsg channel and rpmsg driver */ From patchwork Mon Jun 15 21:38:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11605957 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8BAFF60D for ; Mon, 15 Jun 2020 21:39:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 688F320B80 for ; Mon, 15 Jun 2020 21:39:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="vS56Hc9Y" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726341AbgFOVjI (ORCPT ); Mon, 15 Jun 2020 17:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgFOVjE (ORCPT ); Mon, 15 Jun 2020 17:39:04 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CEAAC08C5C3 for ; Mon, 15 Jun 2020 14:39:03 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id 35so2034127ple.0 for ; Mon, 15 Jun 2020 14:39:03 -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 :mime-version:content-transfer-encoding; bh=0ZItcTsmUJVY1twtF0BYdm5bT4xBfMuVk7qv3zb6xwU=; b=vS56Hc9Y+6xwZb3YQIsz+3gBP4DMWH3udxI9cmVvTwYal9JveZ+ioj53UNtTWyqtKP GICxiLle2yTC5ifZsmqJP4NoRSPOmfP0C7YR6vDkCCDTBrUoc/4giRHzBVsH3dEU3mWi jhVSBmodq2+94kt7it7rFlDAL8GM0KsIiWHokWAwI9YrzZH+qWZXeh24PaHv3zrdrOg0 JjEroQnPeLoleV2pZxR3RsF1YLSCEqkx7nlHeG1/7a0HvB4fgbVY7vjfTaiEY3NChk6b wjGHhffI7AESf1VCCoJlUQAydRI0L/IffAIA3LerXULbJ6yDMdPpcSCISYHFeMe91npM crOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0ZItcTsmUJVY1twtF0BYdm5bT4xBfMuVk7qv3zb6xwU=; b=XUz3CNrdcwYjc7pZlnGn2YXqJHU478XoXKbsQgf7evB/8Tvnkg3t+oDSK7+O5SzGZm GLcPhOLLtJdNMcss7rGtV6DpyhG4GjM2Pi3Qv7GMpkm8ZbHqGq8xLtFiIOJA27IaAxkE bTmgpJCgo7b//RDKEHHL8m8ILJY+sUnjpypCbHNhztc5J7caVC30RnHAwHhb8wN7CjMt 8ol5h64cjDEEh5pl+42/9/xFVVhNVga7eTHAlGHfzICr8oCasrUMLv2t8IVFn/MF6Qnj E2sGiuA4Xn4sVTI6uiHDYziOAiUetfNqp/qdXSwM4SYC/wDUi9UjGBI2FhP/t4gmXShg IfCw== X-Gm-Message-State: AOAM5315J+ayDkGrsWcd3o5w4cp594lGcZ2oXx0RuRX6rvLfttQ89bvp ZT0RsAnfVxg3YT+If9ysm+2jzrbcqKk= X-Google-Smtp-Source: ABdhPJwU2exYO5RI0cLVuvovkkDzg9U57gAEV3V70r9DUJH3KpxpqwjpEE7VHrJgXJlQkGfYgcwVSA== X-Received: by 2002:a17:902:9342:: with SMTP id g2mr17196813plp.36.1592257142928; Mon, 15 Jun 2020 14:39:02 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o186sm8708227pgo.65.2020.06.15.14.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 14:39:02 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 2/3] rpmsg: core: Add support to retrieve name extension Date: Mon, 15 Jun 2020 15:38:58 -0600 Message-Id: <20200615213859.443152-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200615213859.443152-1-mathieu.poirier@linaro.org> References: <20200615213859.443152-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org After adding support for rpmsg device name extension, this patch provides a function that returns the extension portion of an rpmsg device name. That way users of the name extension functionality don't have to write the same boiler plate code to extract the information. Suggested-by: Suman Anna ; Signed-off-by: Mathieu Poirier Acked-by: Arnaud Pouliquen Acked-by: Suman Anna --- drivers/rpmsg/rpmsg_core.c | 93 ++++++++++++++++++++++++++++++++++++++ include/linux/rpmsg.h | 13 ++++++ 2 files changed, 106 insertions(+) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 5e01e8dede6b..5db21f9a6816 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -439,6 +439,99 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv) return of_driver_match_device(dev, drv); } +/** + * rpmsg_device_get_name_extension() - get the name extension of a rpmsg device + * @rpdev: the rpmsg device to work with + * @skip: how many characters in the extension should be skipped over + * + * With function rpmsg_id_match() allowing for extension of the base driver name + * in order to differentiate services, this function returns the extension part + * of an rpmsg device name. As such and with the following rpmsg driver device + * id table and rpmsg device names: + * + * static struct rpmsg_device_id rpmsg_driver_sample_id_table[] = { + * { .name = "rpmsg-client-sample" }, + * { }, + * } + * + * rpdev1->id.name == "rpmsg-client-sample"; + * rpdev2->id.name == "rpmsg-client-sample_instance0"; + * + * Calling rpmsg_device_get_name_extension() will yields the following: + * + * rpmsg_device_get_name_extension(rpdev1, 0) == NULL; + * rpmsg_device_get_name_extension(rpdev2, 0) == "_instance0"; + * rpmsg_device_get_name_extension(rpdev2, 1) == "instance0"; + * + * Return: The name extension if found, NULL if the name of the RPMSG device + * equals the name of the RPMSG driver and an error if no match is + * found or a validation problem has occurred. + */ +const char *rpmsg_device_get_name_extension(struct rpmsg_device *rpdev, + unsigned int skip) +{ + const char *drv_name, *dev_name, *extension; + const struct rpmsg_device_id *ids; + struct device *dev = &rpdev->dev; + struct rpmsg_driver *rpdrv; + bool match = false; + unsigned int i; + + if (!dev->driver) + return ERR_PTR(-EINVAL); + + rpdrv = to_rpmsg_driver(dev->driver); + + /* + * No point in going further if the device doesn't have name or + * the driver doesn't have a table to work with. + */ + if (!rpdev->id.name[0] || !rpdrv->id_table) + return ERR_PTR(-EINVAL); + + ids = rpdrv->id_table; + dev_name = rpdev->id.name; + + /* + * See if any name in the driver's table match the beginning + * of the rpmsg device's name. + */ + for (i = 0; ids[i].name[0]; i++) { + drv_name = ids[i].name; + if (strncmp(drv_name, dev_name, strlen(drv_name)) == 0) { + match = true; + break; + } + } + + /* + * A match was not found, return an error to differentiate with cases + * where a match was found but the name has no extension (see below). + */ + if (!match) + return ERR_PTR(-ENOENT); + + /* No name extension to return if device and driver are the same */ + if (strlen(dev_name) == strlen(drv_name)) + return NULL; + + /* + * Make sure we were not requested to skip past the end + * of the device name. + */ + if (strlen(drv_name) + skip >= strlen(dev_name)) + return ERR_PTR(-EINVAL); + + /* + * Move past the base name published by the driver and + * skip any extra characters if needed. + */ + extension = dev_name + strlen(drv_name) + skip; + + return extension; +} +EXPORT_SYMBOL(rpmsg_device_get_name_extension); + static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env) { struct rpmsg_device *rpdev = to_rpmsg_device(dev); diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h index 9fe156d1c018..9537b95ad30a 100644 --- a/include/linux/rpmsg.h +++ b/include/linux/rpmsg.h @@ -135,6 +135,9 @@ int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst, __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp, poll_table *wait); +const char *rpmsg_device_get_name_extension(struct rpmsg_device *dev, + unsigned int skip); + #else static inline int register_rpmsg_device(struct rpmsg_device *dev) @@ -242,6 +245,16 @@ static inline __poll_t rpmsg_poll(struct rpmsg_endpoint *ept, return 0; } +static inline +const char *rpmsg_device_get_name_extension(struct rpmsg_device *dev, + unsigned int skip) +{ + /* This shouldn't be possible */ + WARN_ON(1); + + return NULL; +} + #endif /* IS_ENABLED(CONFIG_RPMSG) */ /* use a macro to avoid include chaining to get THIS_MODULE */ From patchwork Mon Jun 15 21:38:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11605959 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3092C14DD for ; Mon, 15 Jun 2020 21:39:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 18025208C3 for ; Mon, 15 Jun 2020 21:39:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FbJrV/2k" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726322AbgFOVjI (ORCPT ); Mon, 15 Jun 2020 17:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726341AbgFOVjE (ORCPT ); Mon, 15 Jun 2020 17:39:04 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D458C061A0E for ; Mon, 15 Jun 2020 14:39:04 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id k1so7269592pls.2 for ; Mon, 15 Jun 2020 14:39:04 -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 :mime-version:content-transfer-encoding; bh=4c38Iplb3EjQ2nl2SUevIIMHXwfjFfLx+4gWWneV7Gw=; b=FbJrV/2kiuluaiLm8/jBJDJwbE31GprCK7IBYSPhdMLoE2/ZZqqkB9GiKxq6XlJqvH 47PcQ/5KarTUzTK+DLGDpGPY4sW/lu8ZyURGnd5H/xqyvCQRhyM5JDFbpPruHpZ4Bq5c MQ6clIHPTy8hYdFzjjC924T8RvdBvbcP7toyP7LRtWcCNXi7IlZ6D6rYTt7PnwQwEm1m puaJGI5c+IzfKVfNnqdddWy3aLIBc4fkQ2ZR4NhY2KznMbbrSVWfJzIqF82tG+IGJF6+ vN6YSf4D21XZUAllfI7NOMYTwla4LF7rkjxgWt5ZsH9/t3VFDqgqwy2VizPGiML5Gy2p QatA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4c38Iplb3EjQ2nl2SUevIIMHXwfjFfLx+4gWWneV7Gw=; b=hzSV9OiHipTOewyZk3WJ7Ax1aX6ef2uuUjM57pbTlxGLujBnk2DHFU5j1dUIcz0nT/ +myW2Y7ro3EIM5wTliS+I++/ZJ1jPaIgKOZIgLrelT6OxDs62rpIchWEmkS299BEmu1y otzeRPk+ls8TrNDuPQgkNzMvDlGIUfBZNyQd9fOYG7BzyNUq67f0jNicYbkdCcR/U6e9 dntWQKhoXMSuGXldmM/JVX/P06U5hzGsOrGH92WEdWgrXXu6n/Gyh2k4FY25qeSIXz5N I87QE8DYAYB6dZtwHOGGnXWtnrU1vCGqR7Wxi0l2IoCpQztefBwHmXDjn4rwZExuqW8o u78A== X-Gm-Message-State: AOAM532ajHXmq+h7TY8pslUhII6DtY51PSg0kdYwtD4y3k+WkFXi4t8O pDFZLizLQoxCwPBGJWFf+TAC9w== X-Google-Smtp-Source: ABdhPJwVyJJuL6NLyo+xZovq2Z4Tb7R4l5jvNX9RI1tZdtNTdG8WKFjoEQ5MFQrpayTlNY83EALrlA== X-Received: by 2002:a17:90a:1e:: with SMTP id 30mr1131013pja.25.1592257143782; Mon, 15 Jun 2020 14:39:03 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o186sm8708227pgo.65.2020.06.15.14.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2020 14:39:03 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 3/3] sample: rpmsg: Print out RPMSG device name extension Date: Mon, 15 Jun 2020 15:38:59 -0600 Message-Id: <20200615213859.443152-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200615213859.443152-1-mathieu.poirier@linaro.org> References: <20200615213859.443152-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org Use the new rpmsg_device_get_name_extension() API to print the RPMSG name extension if used by a RPMSG device name. Suggested-by: Arnaud Pouliquen Signed-off-by: Mathieu Poirier --- samples/rpmsg/rpmsg_client_sample.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c index ae5081662283..2c5dc65ed844 100644 --- a/samples/rpmsg/rpmsg_client_sample.c +++ b/samples/rpmsg/rpmsg_client_sample.c @@ -51,8 +51,13 @@ static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len, static int rpmsg_sample_probe(struct rpmsg_device *rpdev) { int ret; + const char *extension; struct instance_data *idata; + extension = rpmsg_device_get_name_extension(rpdev, 1); + if (!IS_ERR_OR_NULL(extension)) + dev_info(&rpdev->dev, "extension: %s\n", extension); + dev_info(&rpdev->dev, "new channel: 0x%x -> 0x%x!\n", rpdev->src, rpdev->dst);