From patchwork Fri May 15 20:56:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11552997 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 E92161391 for ; Fri, 15 May 2020 20:56:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2E082070A for ; Fri, 15 May 2020 20:56:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Q0F5P6QR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbgEOU4r (ORCPT ); Fri, 15 May 2020 16:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgEOU4r (ORCPT ); Fri, 15 May 2020 16:56:47 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAD27C061A0C for ; Fri, 15 May 2020 13:56:45 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id y18so1557139pfl.9 for ; Fri, 15 May 2020 13:56:45 -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=orFzK+6AOl9Sz0N2w3p5SSg3SPmMkMh0jb6dZXjNAFs=; b=Q0F5P6QRitFiue2wR/cDiIouQJpg6OlMJOAvhOfJJJV+BCkRlICHzFBZNVMRT9R79n prN8/iO9zCtF66LVtSXtG8imACYZs01Q4RF/4bHHCZXUq0vEigqUvK56ZWhZCY+6jQDb RtOKwQM+tY1YAHd+htG7fa6bFaM0G2w4saA7Db60YYgHMhUgtz0SZ3fJ/9HkHV625Zmw l5/6sdMVBK3xLrqyiwjY+ZGXgVCdSGLNfAWzBi6WdpX3QhAJEBKZNLBir767ShjgfdwN l5rOwQoE4LOK6tCfNTl/4jpuVlp5rTMHIo2pLNBKNAL1RZGMVfTYn/wBT6YnEcp78pfg AMQw== 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=orFzK+6AOl9Sz0N2w3p5SSg3SPmMkMh0jb6dZXjNAFs=; b=Z5C/fATr0hi16wsa0zpFW96eQVTUXyap3D4pOj4wy8sxp6a4JZsigWAFZjsP/+WWqI Gqotl7sv2zWTq5AmEW0yAEbtGsISfL3VOY53733EY+z6KgSSwwfXaX6jsZ9UBRHhQvoK PCldcYviqyHDyk13egTS3jaI3LDcDSuhQGCYu1XpHHZmCQB2Hg9noYiblkuhZ/JEVvj+ JKHa1+gOpyexECIIjarYfHxZaYbiIb9+peP+yOJ6B0gx/79+SuI8fY1HkETZRgDKyG14 ONqlFcRwwnI5T5+ecip9fwpMtVxXT5aHoHCv+BrmHCDZeoXTguH+a+xWcp7izIZjI+UE H0JQ== X-Gm-Message-State: AOAM532SoLheHUUGQImAY4ZIWJZYMVUlDsCGQH1OdmZnHluHVlLyf5Pj 857j3uvY+plGRrFVF9lHJZUtmQ== X-Google-Smtp-Source: ABdhPJyub8f4D2Sr5kKDWE0uzENCZouJxFMX5Ocsix4afISxccL4y7n7H4oSTBKCRjEoe36DNjepUw== X-Received: by 2002:a62:1b84:: with SMTP id b126mr5815239pfb.123.1589576205487; Fri, 15 May 2020 13:56:45 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id z13sm2208903pjz.42.2020.05.15.13.56.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 13:56:44 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: arnaud.pouliquen@st.com, s-anna@ti.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 1/3] rpmsg: core: Add wildcard match for name service Date: Fri, 15 May 2020 14:56:40 -0600 Message-Id: <20200515205642.13529-2-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515205642.13529-1-mathieu.poirier@linaro.org> References: <20200515205642.13529-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 Fri May 15 20:56:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11553005 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 CDFB2138A for ; Fri, 15 May 2020 20:57:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7DE82070A for ; Fri, 15 May 2020 20:57:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dQEzdhkv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbgEOU4t (ORCPT ); Fri, 15 May 2020 16:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgEOU4r (ORCPT ); Fri, 15 May 2020 16:56:47 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCDDDC05BD0A for ; Fri, 15 May 2020 13:56:47 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id f15so1405807plr.3 for ; Fri, 15 May 2020 13:56:47 -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=GwJdWtZ6c264QmD1Xk9hA26PPDpE566oSpL1VQouYo4=; b=dQEzdhkvU3jFA3oQ8JYJYe/qYbNFMKM8qWJL/2ZeNcZooNUhycOmYpLfYsydXu7F5V SiaXuAUKftAYFJhfr5+s9k6KzfmWGZq7Xv8j5z0QWdW2IozJaJwBZ4OjFioi14hlQLXn Wp9EUj00zhi/b8I3uTxgxMqhtFNMGPRhOS3s/29bj8+tKYe8x5UeOvAEedxb6V8EoFJa hXl0C43tuh10z6k4iCmNGvbGEBY3Yb163KRRBzFQPXWVLNuHkmAIME7dUUBYV5OXC34d 6GD1IKYq0fQRGwiv6+mvU+36ImJW0EOsmwa03KLD41JTa5uHVmPkqI/C1AhAafmrdNBr fIoA== 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=GwJdWtZ6c264QmD1Xk9hA26PPDpE566oSpL1VQouYo4=; b=P6pbk7Dej1zGfB/S6ZoE/OMzdf+HVMldoQ7MDQVoe9qoyksR4KQfDOHnttkvHSFwh+ jxv6xOYlVMVuhAwNqXMTERBkRx7ZGIFbaHEKAohyfgVH3wUnDvxeCQk70tBYvk4kl7SN 9/J1IF92DehhQUF54tKiKJVD1zcXEzBNFHfQfHi3VuHawErpIJbn0j/mUjNGEpg04enB hpWUx/u0NR5k5vECmTllxOMexCuVm2v2J6fyfK28hgmJSeBuGH2FrGagu57GurnG9yO4 FUOQOecl7z6t2dnmNX53cj8FAOjfkW3o1Rz4Jy12+vnQDCds2BkJ/HMSEtTAjNJIw/qm yJsw== X-Gm-Message-State: AOAM531WlEVxLApLvg6YWJJXj70uM7oPleYVK/kA42rMcnd5wPYXi3Vk fSvGQqdvrMFqw6venxyn8tH5vQ== X-Google-Smtp-Source: ABdhPJzWUNJ1UK3Nb7WWuGI0Yv84iO8QKaAmllEfvBNXAc7GfppMlG45/LcRY6wBrtvovL5kEBFCaw== X-Received: by 2002:a17:90a:f003:: with SMTP id bt3mr5377655pjb.3.1589576206553; Fri, 15 May 2020 13:56:46 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id z13sm2208903pjz.42.2020.05.15.13.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 13:56:46 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: arnaud.pouliquen@st.com, s-anna@ti.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 2/3] rpmsg: core: Add support to retrieve name extension Date: Fri, 15 May 2020 14:56:41 -0600 Message-Id: <20200515205642.13529-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515205642.13529-1-mathieu.poirier@linaro.org> References: <20200515205642.13529-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 | 95 ++++++++++++++++++++++++++++++++++++++ include/linux/rpmsg.h | 13 ++++++ 2 files changed, 108 insertions(+) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index 5e01e8dede6b..9583eb936607 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -439,6 +439,101 @@ 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 Fri May 15 20:56:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11553001 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 102B3138A for ; Fri, 15 May 2020 20:57:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EB5EC20756 for ; Fri, 15 May 2020 20:57:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="y/0wl3uo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbgEOU4u (ORCPT ); Fri, 15 May 2020 16:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726722AbgEOU4t (ORCPT ); Fri, 15 May 2020 16:56:49 -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 50D99C061A0C for ; Fri, 15 May 2020 13:56:49 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id t16so1396925plo.7 for ; Fri, 15 May 2020 13:56:49 -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=s8VDhGuf90flrni22PAMq0PKDvRvzu01cgQHrQkAFj4=; b=y/0wl3uo18c7tS7j57d3Zz+JlewUQBMvtMwNWF0DZ7HLH1KZYmL0up0STGVDbMDtyK 7HseB+rrPRH1K+IJ4zFxWycOTsh6YlrcOZc4K7vbjrBwwRr1aEeELQxu/JB0ShYEm65Y Tc4gNrusae8YlRRDo8NchO+oZrGWxqr+GTdQEEgVoynZ0hHV+PyzI2mpXLHZHLPNvp3Z TvltwGzEPHW8vNrozpq/YZBeffCUdr8pQETq0y7jlPy9m3zM3kZicnLcyCZmCCjgyCPK JQA/0p9UKXrucdcZECmSi5EoXCMfOEZFfqgZLoSNRYFBtbfOVef+xs8lVNQ7jXg9a3Sj pxyw== 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=s8VDhGuf90flrni22PAMq0PKDvRvzu01cgQHrQkAFj4=; b=Ti/08cy3i9cMBGn7tPtUPFUVg4ZiThI4PRDorCcX/Z9soyeA3uz4aDnzEiVmn5vWor gHZKXOTK3UHoJq8PjpNxPcarNO777/hf8ZoKpZLn76LPbA6FT0kxWn9nVMUyDh/gorry IvwGqzKAda3pGq9lgRb5aPRBVkCRDZOMc+wFryxYRYcEQ/co8oWpSS5FKjw9QHSk1rmf Z/L4frB7MUOSdVuJw3A/wYcNrSHrJI3zaGNnFQ6zYJqXgjnKIgsrTGfya97/TdzUQGsB oTbXbLLo8y8NZrMoNz6J1Atc9Wp1ssPjmP+eBb0MX1RY9RvlNiQLR99hYNA0/ikkhLeN h0eA== X-Gm-Message-State: AOAM5335rbl6B3eLzKVFEdZ87Tr/rruzIrQZCIbqjnTRMK4G5zVAqmdX MDjQRvTp4kVEYSb+Dk3aZEGhsA== X-Google-Smtp-Source: ABdhPJx24OkkbS2jhgwfSIrmOtBRqe/ry5dIWhu5gs9ECDMAJuQMhtatx9NQP1yAHm23aPdjWmBFUw== X-Received: by 2002:a17:90a:4d4a:: with SMTP id l10mr5560683pjh.0.1589576208902; Fri, 15 May 2020 13:56:48 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id z13sm2208903pjz.42.2020.05.15.13.56.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 13:56:47 -0700 (PDT) From: Mathieu Poirier To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: arnaud.pouliquen@st.com, s-anna@ti.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 3/3] sample: rpmsg: Print out RPMSG device name extension Date: Fri, 15 May 2020 14:56:42 -0600 Message-Id: <20200515205642.13529-4-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515205642.13529-1-mathieu.poirier@linaro.org> References: <20200515205642.13529-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);