Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3753229pxb; Mon, 21 Feb 2022 05:11:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZNbqvxcvmLpC9Uh/Pv2hKTV2QCMrEdEivx9H+ZxFFW/Qiu688Wzmta1n7eBa0r3iimYeE X-Received: by 2002:a17:903:40c1:b0:14d:ce7d:afc0 with SMTP id t1-20020a17090340c100b0014dce7dafc0mr18642517pld.40.1645449082478; Mon, 21 Feb 2022 05:11:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645449082; cv=none; d=google.com; s=arc-20160816; b=LVuBXMygEvE2pRJi1vyyrRgC4fmOSc8SuDMM6Qx01whoUhDLuKTdvLbKACC4QX79TQ eWdTNgY0p4Ob5lT6d7xxDCxAzv9NUqOIKtVCJlNGcGKa4dwsQyQYc6kNGDgNGs7QpaHf ygHRFu6V/E5UauI0MJM9VQg8YoMybgndpjUEq3QF9KoKlR99vnurw4LMKFdq+lozFwwZ lg5utlG++jtFnjD4tRX6H1aSuMSMFOXOCA6z/Br9Tnipflx6ntrKNWvLXP5vjJ3QFMQF dF5gSDo1fexMGpBfqiqM+xH2dylnS4HFr3DZIr1OlTmL1m5mCY7h+26QfmG2HWnEoTf1 xvRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cK92D1j3F84e1W55gsM0/g6c63PjCCbJ7oKZQ2L26Wo=; b=L+EzLJQYwRls1aHWJCkYqMxcszEkHo1j/zzRQLq4EuS9pkBUeM+lpOAMtgw9IMxE8h 7o2n5QtrzZm9rQGpUlZMp3OVPw66iqEiU023WicoxJtKNnM7qyWPZFS5RlPHvTMiHEH/ egL0oHz42AbSfGwC+QsCPWq6oOZdj4RhLdYDuinCDdo83+hcBdadZPfiS504smpaJUwy agiz8Zk3s6JjXlJvID9TV5udCq86aaUKFP7+ElZ22p3aOY9f4RBd/+2otJl7wG1XCCkl RwtCr3WEWpyL6B/Ec66sNyhWy7dnKXofrNpEEeKTsfW+/G/zzH6xyAfyEngrCxA6czyY cAJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kqchKIW9; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9si30725588plr.130.2022.02.21.05.11.02; Mon, 21 Feb 2022 05:11:22 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=kqchKIW9; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348021AbiBUJNl (ORCPT + 99 others); Mon, 21 Feb 2022 04:13:41 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347847AbiBUJJA (ORCPT ); Mon, 21 Feb 2022 04:09:00 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51FD0BAB; Mon, 21 Feb 2022 01:01:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DE1BAB80E9F; Mon, 21 Feb 2022 09:01:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 066BBC340E9; Mon, 21 Feb 2022 09:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434072; bh=qrgm1kzt2di1ONuE+6wLgytVgwd7igoW8PBsESMIvNk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kqchKIW9L9h/ANKoQqggV40kWBTLQEaEdeurwjlvtm1YPdFyarBlQdXoK0tj9J2/6 dmRiRRdMjMC1RXbcbKPmk9RQe0vknPBGRYLLuqSgdXhJbkfARp4AjRFbZiUsaFk6kj 8ex+5OJ7M6BplhSMLM/wuwSnHHQhQPG2vJXNl+Zs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sumit Garg , Jens Wiklander Subject: [PATCH 5.4 52/80] tee: export teedev_open() and teedev_close_context() Date: Mon, 21 Feb 2022 09:49:32 +0100 Message-Id: <20220221084917.282331892@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Jens Wiklander commit 1e2c3ef0496e72ba9001da5fd1b7ed56ccb30597 upstream. Exports the two functions teedev_open() and teedev_close_context() in order to make it easier to create a driver internal struct tee_context. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander Signed-off-by: Greg Kroah-Hartman --- drivers/tee/tee_core.c | 6 ++++-- include/linux/tee_drv.h | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) --- a/drivers/tee/tee_core.c +++ b/drivers/tee/tee_core.c @@ -28,7 +28,7 @@ static DEFINE_SPINLOCK(driver_lock); static struct class *tee_class; static dev_t tee_devt; -static struct tee_context *teedev_open(struct tee_device *teedev) +struct tee_context *teedev_open(struct tee_device *teedev) { int rc; struct tee_context *ctx; @@ -56,6 +56,7 @@ err: return ERR_PTR(rc); } +EXPORT_SYMBOL_GPL(teedev_open); void teedev_ctx_get(struct tee_context *ctx) { @@ -82,13 +83,14 @@ void teedev_ctx_put(struct tee_context * kref_put(&ctx->refcount, teedev_ctx_release); } -static void teedev_close_context(struct tee_context *ctx) +void teedev_close_context(struct tee_context *ctx) { struct tee_device *teedev = ctx->teedev; teedev_ctx_put(ctx); tee_device_put(teedev); } +EXPORT_SYMBOL_GPL(teedev_close_context); static int tee_open(struct inode *inode, struct file *filp) { --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -579,4 +579,18 @@ struct tee_client_driver { #define to_tee_client_driver(d) \ container_of(d, struct tee_client_driver, driver) +/** + * teedev_open() - Open a struct tee_device + * @teedev: Device to open + * + * @return a pointer to struct tee_context on success or an ERR_PTR on failure. + */ +struct tee_context *teedev_open(struct tee_device *teedev); + +/** + * teedev_close_context() - closes a struct tee_context + * @ctx: The struct tee_context to close + */ +void teedev_close_context(struct tee_context *ctx); + #endif /*__TEE_DRV_H*/