From patchwork Mon Jun 10 21:02:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692433 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 8F62BC27C55 for ; Mon, 10 Jun 2024 21:03:10 +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=RlqTlUHK/o9EVoTK6lRW6Vyq5nxREW2O885acP5NIsM=; b=N7wSbu0gxqExAT okD05T43rCfoj6sqMUIrpYrqLPjGBIGLOD/sTOin9Kbr5w6VEVIGLOud2ITfLyvOCwRlkTr4Ci8yS /85g4YlHQJWE65cDcmbha9Ul7OoLu4DRByH0bz/eqfJJ2ELgm2hPNKIohGf4tsXaGCFv7rluC8a4z 3Z2gdk87L8hhcx+V+nQPJT7/wtaDD8arvRpY3VZLtF/o/mYWXkuh4y/8HWHbz/Bw9VSQdZoK8rbzY ugUVbh6PJj5ZUyOmp9Gqh9kz3CNdNde7psmUtO2QkFEsM8NlMGeI5leoLGL1xrzt94G4MdvhgHVfy n5zTfvXTRuF3oGjX1ZXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAN-00000006Tv8-0LLS; Mon, 10 Jun 2024 21:02:59 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmK-1oAA for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053363; x=1718658163; i=wahrenst@gmx.net; bh=ar1NLPxF4FZyTBWrDAr+cKjNP/7T4hUOU0PPMGPmEf8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ll2J9zVlZCgGmXbpbtoe9F6RblFGi+/+3G6KfjXkkGz9sRPUydNY63bYjCGLbF6Q fl1dtgF6R9tK0mXOT0JyHZYFk/tL42scsP15Ylg6bgdIv4NXl4kEnsy5AAfCeGhGx cHamhVg6Qy0BlwenHentdjm2Xa8MDkXk9BZbKNGsTqX+vkponVfPeCRrNbVBYV7RL 30jnJCDh3mxxexFFc44f6x8iq8XuKrm624MrsioV5PTOWP6VQH0yxgXT4FbclYfzJ 3oUMjbPNSs+wrVbRq2+8qNqq/YnHX4fnGczCHGF6aSMeBGSqK+t2iwsxYUfXM95NA Qp7FRW59HIx/79sumQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McpNo-1spYwr1eew-00om7o; Mon, 10 Jun 2024 23:02:43 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH V2 06/10] staging: vchiq_arm: Drop vchiq_arm_init_state Date: Mon, 10 Jun 2024 23:02:16 +0200 Message-Id: <20240610210220.95524-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:8VtTvGmjyY52zusCmOdbftJqeWV9KvMZBiXUHU9nm5Hp3KM1Kul TDjhkJKsftWxyUrsfPv7EZVTcSeldfW6Vmru3uBPCl9xgU75ftccxN9PEWAOhftV+F7rXxg T4JeMRRrR6KHY0ianRd1iO9n+7SXBEtGA68Cb2wGgCpLuFEQOzOXlJEWk4BnUgsiH7JoGqy e1Gs+FTmZKCpC1KzDDmhQ== UI-OutboundReport: notjunk:1;M01:P0:CCDkiY1a3is=;5ad24nRpgTfEV8OFCfuQwi4W5WJ JmKk6y+hxhFgL0ihZBGbNmW4640EIdj1PXjE5eQFwHgDN0nWsnQ8RubPntr6s75hwwUbarVU5 Y0YueQTzETco85MhrtijyRnl6MRbgOA8263phLWVaoi/4ko3FtiIDUiOCEWE85DwB1NDxe8nJ qOIxnFGOfgkwyTPDQo17dndJBpuXhKRLhygcwA/JwNTzMl7nyhFcbbKVMnnZEKZYnF9VGhNTK eVZI5i04o8E2VwCDhuDyTBdD4tvhE0hXn7d6fO02DCC2M8MSc1AVFVcIKgYE4YR7Gl1GXGxlN aeRmcRD4UIe6kqIsmhn+lRmDZM3wUDlbpJA28GWHuNPpcO5oa02q0tywzF1DxNLl03CbGZarq IvFQchhVsFWLWXGMsZdae5mpqjl35QK8151/yaSJWUXoISBxz5dNxIoz2IstIyTyoaU19O0mz CTGAZhCVKLvgzRT1bjfPbk9mDrDs7+yfMmciQzxC/xlVcEmRR7YusVWuf9TSr8QXoM23Ne7/f Bu3cnjbSbgG4W/dk8nVuIquxwO6uarZhw6Sh8yP8srMRvYmFJNEfAtyQuFgc7cQLr8/XaOXcP Bl8Azn+YTnChXZLKllEr9m+Gux+tL1tGsT9zrrTC6Z1qps0/S2VE6ZMe1m1QkvSkVijF5aSSG jx3ZwHJB1BrO1bk1Saq5NexsU2zeQ41q1CK11BAsfmp9TYLc4YosnnS1qYucuEmWRvfGil0cT 4kPQKJFJAptqeqeJWKu1nRLsGCxECEwLp0tq4QTd0TVrpggfKytabE/TMKeKQoUdkkuHQd/vO VJ5Ox+mrXIt/tMsvqeqK6nBy48CB7lJXOikUF4zuZyEIk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140247_973456_64EE0AE4 X-CRM114-Status: GOOD ( 10.42 ) 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 After removal of struct vchiq_2835_state, the init of vchiq_arm_state can be simplified by doing it directly within vchiq_platform_init_state. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../interface/vchiq_arm/vchiq_arm.c | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index 6ef4cf702c78..0ba52c9d8bc3 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -588,23 +588,6 @@ static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state return 0; } -static void -vchiq_arm_init_state(struct vchiq_state *state, - struct vchiq_arm_state *arm_state) -{ - if (arm_state) { - rwlock_init(&arm_state->susp_res_lock); - - init_completion(&arm_state->ka_evt); - atomic_set(&arm_state->ka_use_count, 0); - atomic_set(&arm_state->ka_use_ack_count, 0); - atomic_set(&arm_state->ka_release_count, 0); - - arm_state->state = state; - arm_state->first_connect = 0; - } -} - int vchiq_platform_init_state(struct vchiq_state *state) { @@ -614,7 +597,15 @@ vchiq_platform_init_state(struct vchiq_state *state) if (!platform_state) return -ENOMEM; - vchiq_arm_init_state(state, platform_state); + rwlock_init(&platform_state->susp_res_lock); + + init_completion(&platform_state->ka_evt); + atomic_set(&platform_state->ka_use_count, 0); + atomic_set(&platform_state->ka_use_ack_count, 0); + atomic_set(&platform_state->ka_release_count, 0); + + platform_state->state = state; + state->platform_state = (struct opaque_platform_state *)platform_state; return 0;