Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp157600pxj; Fri, 28 May 2021 00:22:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBertaSWLI7cMR1fpSeBHIJrcaylD6Sw0sm/hYoQUs8z0tOoXVswHspvitB26R9vHNQiWE X-Received: by 2002:a92:d983:: with SMTP id r3mr6238605iln.262.1622186533311; Fri, 28 May 2021 00:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622186533; cv=none; d=google.com; s=arc-20160816; b=qzxdYIZu91ZuqmUSMmUuUGtgp6KwwvVhRxAS2A4gBEqsM3LiZVRaHA7KhnvTE49wmh /7ud2uMV8dJdWw+lBGhh5hL3/Ac+cGsRvk/BQIJr1bxZLltD0xjf5m9+z55zj43g/Xz1 FtGf8eI0mG/ILeiCfuKVMQTvF1n1hikCK4RVpBv14K8qqKM3dmCX13SEsg6uszpTGw+y wF/1O9fZ7XzoVthSzryupfRpRs9MGEmk6dexhjoB1Ic9QJhkEkqKfF6yeDlInUgaxZNg QQP32iCgnEbm6ao28IjyJtTDCEBet6FZt0fuJuAfS8jxM4sK0unji0fXuff//kwbe1+c tyJA== 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=VWWrXtqxypaG6W94Jcb7Nqjb7DgWl7Dvm/E9oGzGZbY=; b=o7Arzo/nPSnYG+bjJpxQ8dy5hk+koVO53g+32/bepCW5iNzYNqz7tX+EeHkR17UgLk GvkN3kVOkbtNjQfyKN36O2FT1Mu1qAfANj/l7nY1nV5QPoEUMo++iNE01WEGTcbW1e0h r42c8VfevY9U2sBPlmoH95gTLwXdk4L+dF61umMN3Fly8GzQe4pNUF6XNp1BZT+VaAQZ 3C0kZXCOUEQ0dKJhFXCDD1XJTTzgFcveKyLnBauPj3cv1E/MCAUtoHlHNXYnGvygiyFh GKrAXr1l5ACQCMWVEvMA+DUAAq7gI/pxTCR+2cAJ9XH0HGEhjKBxVaDQetbu3R1srGIs mfqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gGsvGbKh; 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 k6si4474567ion.34.2021.05.28.00.21.36; Fri, 28 May 2021 00:22:13 -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=gGsvGbKh; 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 S234255AbhE1DqJ (ORCPT + 99 others); Thu, 27 May 2021 23:46:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235754AbhE1DqI (ORCPT ); Thu, 27 May 2021 23:46:08 -0400 Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 086A5C061761 for ; Thu, 27 May 2021 20:44:35 -0700 (PDT) Received: by mail-oi1-x232.google.com with SMTP id v22so2986580oic.2 for ; Thu, 27 May 2021 20:44:35 -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=VWWrXtqxypaG6W94Jcb7Nqjb7DgWl7Dvm/E9oGzGZbY=; b=gGsvGbKh9TFq4frPlNvRb4UTOPbO3ODdYCRS/termttaL9wBaX/aVYbXiCVDAI8hMc 3hw0s9WwmHoxF5hjnKKreRK1hjcX9JzboDsyo7opzQPjDFWZVP8iw+2c0sqs/ON4FFwq ImwSfnInJr0JrFAx0pjBIbHg6GInSbC1WafQCc839WqhLqCgjavP+XkM9C1sC6MGLX1e M0WOF9n4SVU8oysKjHTA2DG9+Jd724cUJmCY9msOZq3HfTYBLOtSukYgWZBPsXUNgyU7 nYcg/hPNrJG/MQtTWJZgZM1e69rf1/cdg8h4oi/Rj5NbZbIInlSHb66TEJ/EXVISbVVN pfZA== 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=VWWrXtqxypaG6W94Jcb7Nqjb7DgWl7Dvm/E9oGzGZbY=; b=hu6Vx7aTWJ/TnDlrgAU32kIhbZpCyi/62iEy/x6XJQXWRr7TTyyLIbrA5uv1n1jzMc 6FnJXwWGyYnv0/nTBxw5owNJBGi4Ief3kKDmi11ziyKrLIbqrV94VbOuwa90ZgXLN8RF i7I1zOLHNvZLT4iNb/Ri6mwvMgfFtQEuc3QeMG2IM8PflHOce4XlWEtC2b+EfCQt0XeH ynu+olms3oLguoYbSV/sqdYi2a9eBAlZlCBzcL/jk39aXVSAVeviOTorUN5njpfs335O 4VsSJN3BtobGnX2siy4qBZgl+MpRxcXXDGydPvNa2mbny399rtIku/6dfpQ2RvWYssoG QVXA== X-Gm-Message-State: AOAM533qQsvVmTpGYXrfyjDxq9P2nU+ApDYNERoyoYCJlsjT0xHwnDNT saGLSTsKWY6nlRuaAE4NbJsSug== X-Received: by 2002:a05:6808:1149:: with SMTP id u9mr4467883oiu.61.1622173474368; Thu, 27 May 2021 20:44:34 -0700 (PDT) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id p22sm846364oop.7.2021.05.27.20.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:44:33 -0700 (PDT) Date: Thu, 27 May 2021 22:44:32 -0500 From: Bjorn Andersson To: Siddharth Gupta Cc: ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, psodagud@codeaurora.org, stable@vger.kernel.org Subject: Re: [PATCH 2/3] remoteproc: core: Move validate before device add Message-ID: References: <1621284349-22752-1-git-send-email-sidgup@codeaurora.org> <1621284349-22752-3-git-send-email-sidgup@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1621284349-22752-3-git-send-email-sidgup@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 17 May 15:45 CDT 2021, Siddharth Gupta wrote: > We can validate whether the remoteproc is correctly setup before > calling making the cdev_add and device_add calls. This saves us > the trouble of cleaning up later on. > Reviewed-by: Bjorn Andersson > Signed-off-by: Siddharth Gupta > --- > drivers/remoteproc/remoteproc_core.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 562355a..45d09bf 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -2316,16 +2316,16 @@ int rproc_add(struct rproc *rproc) > struct device *dev = &rproc->dev; > int ret; > > - /* add char device for this remoteproc */ > - ret = rproc_char_device_add(rproc); > + ret = rproc_validate(rproc); > if (ret < 0) > return ret; > > - ret = device_add(dev); > + /* add char device for this remoteproc */ > + ret = rproc_char_device_add(rproc); > if (ret < 0) > return ret; > > - ret = rproc_validate(rproc); > + ret = device_add(dev); > if (ret < 0) > return ret; > > -- > Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >