Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1629508pxb; Thu, 4 Mar 2021 16:56:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBMu/Me9KUJZR0jwz8j+RJX3kARKS9PiXPQSiN+jyFGag9eeRVJfO5yZB99rTPc/kOc7wN X-Received: by 2002:a6b:6206:: with SMTP id f6mr5788079iog.18.1614905787316; Thu, 04 Mar 2021 16:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614905787; cv=none; d=google.com; s=arc-20160816; b=dRBKQBiunrL3em7wQBOkOfeB2f4s+pZiCv3z73YGBUE8irmXJL7iVdrtVKP8B9wGrf fTvlnoxwrkZB94Gif4DDIWV2TgQJzosTESwGXCoLE0cVLEznHuyG0N6TyflcaMss6OJE 5/JZyi6ECVj39nWOWM9I/kwjmmbygXdKt9A4+nKx8r3NzafHHYegJsOIzFd2Qck0w+NU EmrTCWD5vfyUbLiehAsTPbilEznBg0Kc5TFUcUPBdHxP4VfSkSV2rUCyWevVJVo1QO3M crAc4fhhM6xq5XBFHsRKZr73oNy2X+afVyez5rg7lNX8H0DepUWrH0PeTSTQrjGJVugs 728Q== 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=rbbyP4f7puqulTra1fDP6OcDsptLygIaw3JP1xb77tM=; b=maWMtE2mIBZSyw9OGLNWHXp1LTA+urF/X4c/9XF4/Wri+WPMBn0i7jHw2cwoyGJ9PF 4axq1MMeZJkQLGaNIHW22A1oHjrOq8tOfu0nr7MQiep6gnSyxxjbvcuI2pMt4Rkt0bR6 X0p21T6rpir96xZkbpGYfHwL6+53YJEfCjtKY2ondHAWZJ6pxn3gGIpo/JPf8fY4ILTr RAgmZTPp342URa8vPYKIFDXm6AOHJS0pTkwYPZgXS6PraM4wQHdxfiuzWquBi4NiuSCe p1QWX1GeUwARXkVpDM8kkxZMAf2CwRv45MZYWTi4/lEbhirOseqJ8lmVyMHIejsf8UER zbDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fadB5UiT; 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 p8si790743ilc.145.2021.03.04.16.56.14; Thu, 04 Mar 2021 16:56:27 -0800 (PST) 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=fadB5UiT; 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 S236627AbhCDTHD (ORCPT + 99 others); Thu, 4 Mar 2021 14:07:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236768AbhCDTGk (ORCPT ); Thu, 4 Mar 2021 14:06:40 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE69EC061760 for ; Thu, 4 Mar 2021 11:05:59 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id d12so17071525pfo.7 for ; Thu, 04 Mar 2021 11:05:59 -0800 (PST) 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=rbbyP4f7puqulTra1fDP6OcDsptLygIaw3JP1xb77tM=; b=fadB5UiTzffTtxrnqdd8PhIkKLTzeY5XXE5bdX4vJi9wo5p/1BA58D1ACxEGMuIXJo uRdV+JdUT+4TivRh1Y40BT7tBt05iF3Tz+jLltT8q+VcbuFdOFg+2BbGlOhl2nPI5mQN 4lwwe1QpLvzBeIwu2bP1lHAPbZMo0UurQ8Q2ArljOCzw8/qTlcmYslAtXIPic2EMbECj cdZCaoCA3q4OIWue/ZYMje4G8wQSt2UGacFpsykcWPznbxJR2tF86woEKSo30D3ge1IK TvQkapUM9mbMHGPF+Jmp2IgSipfBrZoPAOUpOpk9yVHDrrFEj5JMOGn1W1Dtcak7NGNR 2P5Q== 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=rbbyP4f7puqulTra1fDP6OcDsptLygIaw3JP1xb77tM=; b=WxSLOTXqVrp+o4cSRaZJX2TRC3RwunUuJ6mJ9ogdQoqvhsgAoQ351svzLVN1rHVIbu Gtp6OV7x1JSTwlDpGI/wVuCWZ40VtzXT4BADVfg+mcglCnYHqA3GB7KETdf68UGHsURy +9lYfqyu97RSLU8YBDccmrU05r6a359KL3PvdEsqPM8d45e1+oGpy9gQkkI3IL2lZO0K BVMdTVJ+1Pc+PpVpFraG5DK1zXJs2f/P7mCP/sjNCXePjIzh1XDSrZlEWra/GBGp+uAH QI8a5MBPRU2z9lAqXPyedjZGLgrjag1TqybdlcNCHQ73rNdWJpc6eh012gcfV3ODSP/M VfMw== X-Gm-Message-State: AOAM533/FI3CIaQDnDIWdDDrM91fKTfS5r5t2PlSNZmLhPc2l0TgHKKt AbKcq2eef2J/BJyfdFRzdcnmvg== X-Received: by 2002:a63:4241:: with SMTP id p62mr4758259pga.453.1614884759096; Thu, 04 Mar 2021 11:05:59 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id 188sm146234pfz.119.2021.03.04.11.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 11:05:55 -0800 (PST) Date: Thu, 4 Mar 2021 12:05:53 -0700 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 v5 13/16] rpmsg: char: introduce __rpmsg_chrdev_create_eptdev function Message-ID: <20210304190553.GD3854911@xps15> References: <20210219111501.14261-1-arnaud.pouliquen@foss.st.com> <20210219111501.14261-14-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210219111501.14261-14-arnaud.pouliquen@foss.st.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 19, 2021 at 12:14:58PM +0100, Arnaud Pouliquen wrote: > Introduce the __rpmsg_chrdev_create_eptdev internal function that returns > the rpmsg_eptdev context structure. Add newlines between paragraphs. > This patch prepares the introduction of a RPMsg device for the > char device. the RPMsg device will need a reference to the context. s/the/The s/RPMsg/RPMSG - throughout the patchset. As a general note please be mindful of patch changelogs. I often find myself having to decipher the ideas being conveyed. I am done reviewing this set. There are things I will want to come back to but the general goals behind the patchset are being achieved. Thanks, Mathieu > > Signed-off-by: Arnaud Pouliquen > --- > drivers/rpmsg/rpmsg_char.c | 23 ++++++++++++++++++----- > 1 file changed, 18 insertions(+), 5 deletions(-) > > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c > index 09ae1304837c..66dcb8845d6c 100644 > --- a/drivers/rpmsg/rpmsg_char.c > +++ b/drivers/rpmsg/rpmsg_char.c > @@ -328,8 +328,9 @@ int rpmsg_chrdev_eptdev_destroy(struct device *dev, void *data) > } > EXPORT_SYMBOL(rpmsg_chrdev_eptdev_destroy); > > -int rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, struct device *parent, > - struct rpmsg_channel_info chinfo) > +static struct rpmsg_eptdev *__rpmsg_chrdev_create_eptdev(struct rpmsg_device *rpdev, > + struct device *parent, > + struct rpmsg_channel_info chinfo) > { > struct rpmsg_eptdev *eptdev; > struct device *dev; > @@ -337,7 +338,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; > @@ -381,7 +382,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); > @@ -391,7 +392,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 rpmsg_eptdev *eptdev; > + > + eptdev = __rpmsg_chrdev_create_eptdev(rpdev, &rpdev->dev, chinfo); > + if (IS_ERR(eptdev)) > + return PTR_ERR(eptdev); > + > + return 0; > } > EXPORT_SYMBOL(rpmsg_chrdev_create_eptdev); > > -- > 2.17.1 >