Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1542214pxf; Fri, 9 Apr 2021 10:55:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCsRCBVGRjvM8NPEEpdGz1Nn+izNJd8h2or8RpmVTt8AIiq65NvtM6y3rD5EDdxnMM0akK X-Received: by 2002:a17:906:94c9:: with SMTP id d9mr17024041ejy.314.1617990919682; Fri, 09 Apr 2021 10:55:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617990919; cv=none; d=google.com; s=arc-20160816; b=Ano+hd2+abTuKAm8y780ayulz4BvpeeUnLzU064U8/gX78Bgt/6S2pKdkSr4DyrwJC AoAtHrLy5xXJb/3qpq/8iBog/0eES77QqS88cGzla8JibuGc6+h9QsHdkXfGThXyx69F f2eQgFAC6KFihPsA8hjQOBh3WljB93NZA2ilMal7AKWMJkhLmaUEaHleLgX8kLKr1/G8 w/lzJfz/x95mEX/fXSsJYMLiDKqi/yOp5gUKGxr6rjQx+mVfUZ8rVfQ6DFqCiapW/kng Kh43ezZ5iaF7dO1i5dknmIC1GkHCVKGgCUdZ4mCclsLlKEbV+++aWyYGZgUse6l5M2hJ NsiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=t0lA/jFVR3TTCjtnv1uyJJiTbsD33ku905quI/YeL/8=; b=wVAhGtjE5buBlOqw76XdnOhXp9GzxL9as58bC5cAXOsF7v2SSK4fQSFh4hTNvYDsPa ftlbJJyDReCazc1VKakZ/vXQ4lfALCAQN9LDS3k9NXuoA55fXKAMqcs7z7dLErx8UVcU HQ5dUptRpSxHw0EAiWdYo/7vrphilAL0rUi6DRDqZ6qFe8NsflMjNykoWWs9VtSl5SBS O8XUvtw3Iaf0ZTBYpz8Ry1aA0hjv3OHVW1kL+XWR9Ig7IPJRXrx2/IprAPugFq3rlqoK Wl6gk/LlJhYkFU811YbJZ9WG7UpyByb10+pUXNkErJ7BmF2KBI1IJbhANh7bmPaUACIC xxjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ujzqBY4P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q20si2736590edd.31.2021.04.09.10.54.55; Fri, 09 Apr 2021 10:55:19 -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=pass header.i=@linaro.org header.s=google header.b=ujzqBY4P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234262AbhDIRyK (ORCPT + 99 others); Fri, 9 Apr 2021 13:54:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233332AbhDIRyJ (ORCPT ); Fri, 9 Apr 2021 13:54:09 -0400 Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185F6C061762 for ; Fri, 9 Apr 2021 10:53:55 -0700 (PDT) Received: by mail-pf1-x432.google.com with SMTP id s11so4739567pfm.1 for ; Fri, 09 Apr 2021 10:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=t0lA/jFVR3TTCjtnv1uyJJiTbsD33ku905quI/YeL/8=; b=ujzqBY4P8EW3BO2TN+Pcc1TuyrOGLeEzdi6LjPKFvGdzOrzLy+E3xdB6qDl7lnihv7 mtR4mmom/nb94xbAaHAgP4YyETgvmhM99+46KpKkZiu7Mk73tAWdkdVgVaRqYJKW0hQI Bqa8PL8+fsaU9pm6TbG3aH7vLnq4jvdzsY87YLCIbLDBO8va6hggYohkPwYFX2cUKf5w VPXOBlEuxvHCiVhsPdUgwzjmx6BRnMTva66Bvgr+a6430LOyipUkgDPeMdxZeU1kv9Iz bST5+/kITQOvnzSmXiePB5EZlE9qgE6+aJ1EyCp36p4diDPPk6Ikgv+1G/OM1+JHsh4u Qpww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=t0lA/jFVR3TTCjtnv1uyJJiTbsD33ku905quI/YeL/8=; b=NGIauIP2GbFfQuyfBn09fZjQn+OyWQ9cpvi7ZPvsTpfc04OdhZZLdO2YRaITW4Z8Zn CO+OaG1Lauh/Djs1u3FVp4OG9zkjTpzK4WoXaxYmzmN37TQnKsX92GCdi5cJ4Oe/dxMU XnL6TCmBc7k/oEm1KX25Y1oGJXqMy7QtRsOjZ6SgSJnz0IULzFuBzxDXLN/t8XKBSNQR oByhSqb58mH5F7JJ7/iyhHbcKkNAMlp251m/jdHwXSUxa6KzzzHjynQWGZBHJmxI8r7K a0d7XoPLiiI3Z6WcZzeAqQMOqnYb39zdk7z3iBfjdGdKsI0OVLY1YhT9sFWV6daf7sdW t8fg== X-Gm-Message-State: AOAM531xfnVHtyFKPnraBSJwV734qHdk3BYfcDSpQ4YjINmSHhBjLRH9 hj1h90TWGTjV415zZkzrIf4m1Q== X-Received: by 2002:a05:6a00:883:b029:247:562:f8f9 with SMTP id q3-20020a056a000883b02902470562f8f9mr3739481pfj.34.1617990834443; Fri, 09 Apr 2021 10:53:54 -0700 (PDT) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id n73sm3049665pfd.196.2021.04.09.10.53.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 10:53:53 -0700 (PDT) Date: Fri, 9 Apr 2021 11:53:52 -0600 From: Mathieu Poirier To: Arnaud Pouliquen Cc: Bjorn Andersson , Ohad Ben-Cohen , Andy Gross , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 4/7] rpmsg: char: Introduce __rpmsg_chrdev_create_eptdev function Message-ID: <20210409175352.GB489094@xps15> References: <20210323122737.23035-1-arnaud.pouliquen@foss.st.com> <20210323122737.23035-5-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323122737.23035-5-arnaud.pouliquen@foss.st.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 01:27:34PM +0100, Arnaud Pouliquen wrote: > Introduce the __rpmsg_chrdev_create_eptdev internal function that returns > the rpmsg_eptdev context structure. > > This patch prepares the introduction of a rpmsg channel device for the > char device. The rpmsg device will need a reference to the context. > > Signed-off-by: Arnaud Pouliquen > > --- > update from [1] > - propagate parent param in rpmsg_chrdev_create_eptdev, > - fix changelog. > > [1] https://patchwork.kernel.org/project/linux-remoteproc/patch/20210219111501.14261-14-arnaud.pouliquen@foss.st.com/ > --- > drivers/rpmsg/rpmsg_char.c | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c > index 5d4a768002ce..7f6d46078179 100644 > --- a/drivers/rpmsg/rpmsg_char.c > +++ b/drivers/rpmsg/rpmsg_char.c > @@ -325,7 +325,8 @@ static void rpmsg_eptdev_release_device(struct device *dev) > kfree(eptdev); > } > > -int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent, > +static struct rpmsg_eptdev *__rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, > + struct device *parent, > struct rpmsg_channel_info chinfo, struct class *rpmsg_class) Please fix: static struct rpmsg_eptdev * __rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent, struct rpmsg_channel_info chinfo, struct class *rpmsg_class) > { > struct rpmsg_eptdev *eptdev; > @@ -334,7 +335,7 @@ int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent > > eptdev = kzalloc(sizeof(*eptdev), GFP_KERNEL); > if (!eptdev) > - return -ENOMEM; > + return ERR_PTR(-ENOMEM); > > dev = &eptdev->dev; > eptdev->rpdev = rpdev; > @@ -378,7 +379,7 @@ int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent > put_device(dev); > } > > - return ret; > + return eptdev; > > free_ept_ida: > ida_simple_remove(&rpmsg_ept_ida, dev->id); > @@ -388,7 +389,19 @@ int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent > put_device(dev); > kfree(eptdev); > > - return ret; > + return ERR_PTR(ret); > +} > + > +int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent, > + struct rpmsg_channel_info chinfo, struct class *rpmsg_class) > +{ > + struct rpmsg_eptdev *eptdev; > + > + eptdev = __rpmsg_chrdev_create_eptdev(rpdev, parent, chinfo, rpmsg_class); > + if (IS_ERR(eptdev)) > + return PTR_ERR(eptdev); > + > + return 0; > } > EXPORT_SYMBOL(rpmsg_chrdev_create_eptdev); > > -- > 2.17.1 >