From patchwork Fri Apr 29 11:39:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 12831881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 08B90C433F5 for ; Fri, 29 Apr 2022 11:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zjHQ8QBHbQYfrzIBOFjV86/ss3GUGT2yTlFRywh4XnM=; b=LIZna1K0ZnppWD b5neC51diBa71vPKiek1AqAqqy3fGTCe9lSQjpk0VxFjRfHhoiMY+0Bz7PD5yzGVyxUWf0vw6pYvT v85E1l80uQBtNoYwSUqzMBnP1jFOkXssTtygOCk4nfDLnxli4ZxE2lVMjBn6O/R+QTcSdnAh4BCK1 hcP9Ae3iAWw2hazzM1W/Rnz9RE75Jcmep0TF4hqrVfNJHAUnHXoOuaLiH+6jCyoXCLPNO1gQG84uS cGyhCHRy8mKI3ZV1pplEfp8Jf1aKM8vmZaKkHu7Z6wXop0BZ0DMY5NOWd9PM4RQSGj3qIj5Fo4LMM Lx/KaxSjjRaawe/Asn4A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkOyw-00AzC9-4g; Fri, 29 Apr 2022 11:40:18 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nkOyh-00Az9F-3s for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2022 11:40:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A7BA111FB; Fri, 29 Apr 2022 04:40:01 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B6CD73F73B; Fri, 29 Apr 2022 04:40:00 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, op-tee@lists.trustedfirmware.org Cc: Sudeep Holla , Arunachalam Ganapathy , Jens Wiklander , Sumit Garg Subject: [PATCH 3/4] firmware: arm_ffa: Add ffa_dev_get_drvdata helper function Date: Fri, 29 Apr 2022 12:39:45 +0100 Message-Id: <20220429113946.2087145-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220429113946.2087145-1-sudeep.holla@arm.com> References: <20220429113946.2087145-1-sudeep.holla@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220429_044003_243216_B2C5653A X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a helper function to fetch ffa_dev's driver_data using dev_get_drvdata. At the same time move existing ffa_dev_set_drvdata to use dev_set_drvdata. Suggested-by: Arunachalam Ganapathy Signed-off-by: Sudeep Holla --- include/linux/arm_ffa.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index 85651e41ded8..e5c76c1ef9ed 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -38,7 +38,12 @@ struct ffa_driver { static inline void ffa_dev_set_drvdata(struct ffa_device *fdev, void *data) { - fdev->dev.driver_data = data; + dev_set_drvdata(&fdev->dev, data); +} + +static inline void *ffa_dev_get_drvdata(struct ffa_device *fdev) +{ + return dev_get_drvdata(&fdev->dev); } #if IS_REACHABLE(CONFIG_ARM_FFA_TRANSPORT)