From patchwork Sat May 22 00:03:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 12274143 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C7B3C04FF3 for ; Sat, 22 May 2021 00:07:44 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D0FCE6138C for ; Sat, 22 May 2021 00:07:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0FCE6138C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nrTNJS/YYXnFcoc34htbTaQjCqU5tnDTF0tjg3272Y4=; b=Ry4AIlr5oFJsmnn3iN72TzgWvv uRbZNJgOI49mmFq+DXJvLCBlgoxXrwGVd01eFqHp96yCoFLsCi/+XQE/TxUHSrJE6NkcL+ojljO+K QVZ9emwyCA3BhpswcKv6J8z1IWMOMN9KYa+8J1zERlRdx9X9W4dyJ8kbJxjAwzN/fE9AAwusnWzqE ZX581ehmi66UBuxCkilIIl7VouxbxqvJ8nW5zPAXjG4YjRNBPuxcQwqeW1KWYB2oR/mwiNFCA3QqO /dZKS+X32saOa8nxoir0yB8dRscV6pOeg41ujmHAC7zKPRaQ6ngJ4lTmmAJQI83oPAXx/JydTv8nT FkDSKD0w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkF77-001Prf-1x; Sat, 22 May 2021 00:03:34 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lkF74-001PrF-Fe for linux-arm-kernel@desiato.infradead.org; Sat, 22 May 2021 00:03:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description; bh=rIsAFzqfSDl4qnomEf/i3Yun1KIgz+WMiy2kwkK3VVc=; b=AZ0HQyA5EhjBaP1qSGCJO0RFvV jBXuOoxrECZjc1fu3Jj++2IDijP4/Wf+6swasYcsYaP31RqnjKDjMNKHNXzpX6vukGxnn9y4scmOD 8Xw/+AINUvgm3PamWuxKFVA1zFqt+ZgAO0devkkypYDlPin43oNK4JIm1s9XukcP/GpvXmDePdcKO iJdfLVvqDtx01jfyXj9F8hMi4tczmv9SXPVblnh1DdWSFpM9CDixeSWiTl786Q525wvGnhOYbyRfD qzvt7EmM3qdmN7X8bf07nXsVY6u3+3DAk1+rgQXFsN9G5DXMP3vv2RERw/mk62gmq2lt4iBseWPzU DQjCPHoQ==; Received: from fllv0016.ext.ti.com ([198.47.19.142]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lkF70-00HVMz-U8 for linux-arm-kernel@lists.infradead.org; Sat, 22 May 2021 00:03:29 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 14M03LDL087850; Fri, 21 May 2021 19:03:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1621641801; bh=rIsAFzqfSDl4qnomEf/i3Yun1KIgz+WMiy2kwkK3VVc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=M+/G4idxvr+0cMA+heAG/9siC4UhZTmUQI9VuKgCiUqpOlneIRMMoth5BF6C997FM GVunOBWOFc9F8P5AdM/N6K0WTKnpSMahKCInZipqAPOjKac/KUszwJPnjAjT8RJqjP 9k81C1cG76sgfbVCUH35VxTLizKGHzv4PGOyMU4o= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 14M03LS6123691 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 May 2021 19:03:21 -0500 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Fri, 21 May 2021 19:03:21 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Fri, 21 May 2021 19:03:21 -0500 Received: from fllv0103.dal.design.ti.com (fllv0103.dal.design.ti.com [10.247.120.73]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 14M03LZf089883; Fri, 21 May 2021 19:03:21 -0500 Received: from localhost ([10.250.35.153]) by fllv0103.dal.design.ti.com (8.14.7/8.14.7) with ESMTP id 14M03LTJ091513; Fri, 21 May 2021 19:03:21 -0500 From: Suman Anna To: Bjorn Andersson , Mathieu Poirier Subject: [PATCH 1/6] remoteproc: Introduce rproc_detach_device() wrapper Date: Fri, 21 May 2021 19:03:04 -0500 Message-ID: <20210522000309.26134-2-s-anna@ti.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210522000309.26134-1-s-anna@ti.com> References: <20210522000309.26134-1-s-anna@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_170327_922565_58D1333E X-CRM114-Status: GOOD ( 13.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tero Kristo , Lokesh Vutla , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .attach() rproc ops is invoked through the helper rproc_attach_device(), but the .detach() ops is invoked directly at present. Introduce a similar wrapper function rproc_detach_device() for .detach() ops so that the code is symmetric. Signed-off-by: Suman Anna --- drivers/remoteproc/remoteproc_core.c | 2 +- drivers/remoteproc/remoteproc_internal.h | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 6348aaa42bbb..6019f46001c8 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1869,7 +1869,7 @@ static int __rproc_detach(struct rproc *rproc) } /* Tell the remote processor the core isn't available anymore */ - ret = rproc->ops->detach(rproc); + ret = rproc_detach_device(rproc); if (ret) { dev_err(dev, "can't detach from rproc: %d\n", ret); return ret; diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index a328e634b1de..931d50b6a0d1 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -121,6 +121,14 @@ static inline int rproc_attach_device(struct rproc *rproc) return 0; } +static inline int rproc_detach_device(struct rproc *rproc) +{ + if (rproc->ops->detach) + return rproc->ops->detach(rproc); + + return 0; +} + static inline int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw) {