From mboxrd@z Thu Jan 1 00:00:00 1970 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=-19.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 0EDA5C04FF3 for ; Sat, 22 May 2021 00:03:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2F28613FE for ; Sat, 22 May 2021 00:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230269AbhEVAFB (ORCPT ); Fri, 21 May 2021 20:05:01 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:40086 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbhEVAE7 (ORCPT ); Fri, 21 May 2021 20:04:59 -0400 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 CC: Lokesh Vutla , Tero Kristo , , , , Suman Anna 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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) { -- 2.30.1