Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1698479iol; Fri, 10 Jun 2022 12:56:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq3NBnPbqekRumKSWsqa8Q7NBlHrP1HQ73KSAwwgcduamcfmLvNImzkVDVseJOUx7nCEtk X-Received: by 2002:a17:906:a188:b0:70c:1e17:b833 with SMTP id s8-20020a170906a18800b0070c1e17b833mr38306147ejy.271.1654891012232; Fri, 10 Jun 2022 12:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654891012; cv=none; d=google.com; s=arc-20160816; b=ItP+apB0L9lOFPrsHB6tFmjHp1Fd2q4vWTRptePaytZq39LM9Ev/1aw5xDXFEZJN0E hPH1+AyHAm0unDiRVVtgCseatv02omzXlUQcCv2C2HEz3j77Pc430dVdmQbyKMEVly4j hssSAPcMzdwxBr6G9p+fB+eTLjZvzUWbCHIGS9HWi4JHpuU/iuE2OJCGb3ycngp429hn 43naVLyvXFhOA/Kea5qcSHisSuvhHlP9NATiuOLJz+Lxg0naAAmLS7LXe9nJomersR6v WDjzEgngmnrj8kBzPUlGUppFe4FyKO0LUdlOpDfrB+ntAD+LhxafCX6bj+hDIWS1+DUi Fzag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=S+DeJ3MsyXef9jo7MlX4F9bDqqCTfY+AdSWc6kyR9DU=; b=WHKt8VjoJfwn7jwAoucFDoZP1ToXPiyyp7f9X6tfMI47XUAeKk/2vail6fntobHEh8 PJ9VhugL/Ikw2aEVVsOcy3gcSjb/DeSny4tvlGV5GMRARDIggqHbakQQZ1pAzmEZfGPa Hj+OPCvRsUaBk4sUSyxt0UuJTNACIRE6QwP1SzS0Z+VKpugVPkLG+bk+ED1sVmdcKr6Q 0ZSCPYvL7M0gNFn1r+O6SJdKozXC+EFxVQKhziZDDbOct+3ZQf6PcOBOi4iHsP9p5T+T ZeoVeeMkg+cLlhSiKbiHCa9kO8kF5Nu8w62E2uRHAD5arJ3ad25MceE69P8MI46Zdc+W 1NHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ncy1UTC5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e8-20020a17090658c800b006fee28c47a7si42560ejs.9.2022.06.10.12.56.20; Fri, 10 Jun 2022 12:56:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ncy1UTC5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349933AbiFJTXm (ORCPT + 99 others); Fri, 10 Jun 2022 15:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348545AbiFJTXi (ORCPT ); Fri, 10 Jun 2022 15:23:38 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DC7B19A711; Fri, 10 Jun 2022 12:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1654889015; x=1686425015; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=S+DeJ3MsyXef9jo7MlX4F9bDqqCTfY+AdSWc6kyR9DU=; b=ncy1UTC5atH6gW77/v/eQAPDyQK9dErNoTeO9y0XPdZGqiz1kTxCgaSU KY6a2M2ydId3Ivbp/9YYMt7YTBTW/YbddmDi2XguXN5Y9UdaXJbRQfny1 6G2F3R5yPfFOXFCh7Xma4zUoLuoWLfhJcp9e64u0yRHhCMY/QXFL6yNYY 4=; Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by alexa-out-sd-01.qualcomm.com with ESMTP; 10 Jun 2022 12:23:35 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg02-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jun 2022 12:23:34 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 10 Jun 2022 12:23:33 -0700 Received: from hu-clew-lv.qualcomm.com (10.49.16.6) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 10 Jun 2022 12:23:33 -0700 From: Chris Lew To: , CC: , , , Subject: [PATCH 2/2] remoteproc: core: Introduce rproc_mem_entry_free Date: Fri, 10 Jun 2022 12:23:05 -0700 Message-ID: <1654888985-3846-3-git-send-email-quic_clew@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1654888985-3846-1-git-send-email-quic_clew@quicinc.com> References: <1654888985-3846-1-git-send-email-quic_clew@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Introduce a helper to free the rproc_mem_entry allocated by rproc_mem_entry_init(). This helper is to help manage rproc carveouts added to an rproc outside of remoteproc. Signed-off-by: Chris Lew --- drivers/remoteproc/remoteproc_core.c | 13 +++++++++++++ include/linux/remoteproc.h | 1 + 2 files changed, 14 insertions(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ee71fccae970..161691fd2e96 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1069,6 +1069,19 @@ rproc_mem_entry_init(struct device *dev, EXPORT_SYMBOL(rproc_mem_entry_init); /** + * rproc_mem_entry_free() - free a rproc_mem_entry struct + * @mem: rproc_mem_entry allocated by rproc_mem_entry_init() + * + * This function frees a rproc_mem_entry_struct that was allocated by + * rproc_mem_entry_init(). + */ +void rproc_mem_entry_free(struct rproc_mem_entry *mem) +{ + kfree(mem); +} +EXPORT_SYMBOL(rproc_mem_entry_free); + +/** * rproc_of_resm_mem_entry_init() - allocate and initialize rproc_mem_entry struct * from a reserved memory phandle * @dev: pointer on device struct diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 43112aa78ffe..9b039f37da12 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -666,6 +666,7 @@ rproc_mem_entry_init(struct device *dev, int (*alloc)(struct rproc *, struct rproc_mem_entry *), int (*release)(struct rproc *, struct rproc_mem_entry *), const char *name, ...); +void rproc_mem_entry_free(struct rproc_mem_entry *mem); struct rproc_mem_entry * rproc_of_resm_mem_entry_init(struct device *dev, u32 of_resm_idx, size_t len, -- 2.7.4