From patchwork Mon Jun 29 15:09:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 11631187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4C9414B7 for ; Mon, 29 Jun 2020 15:33:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F020251E3 for ; Mon, 29 Jun 2020 15:33:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CjxTg9Xs"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ToxdlF+C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F020251E3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4YWe6MaAPQCbDIbBzr9q2lVooT6/6aHISsJo400vR3Q=; b=CjxTg9XsAFI4kxK/qC92A0Kiw e1Igfnj0+Sl0+PuQ6aQSIZ3Unbki0Nslv/oqmxdr4mjgeDT9B+d0Mf5zksBr81E4vIN8BCN/dZA3c weFVuBPqCP2fmVPtT84q76t6kdCnwbTZNs7KR2xAjVxhb2wPhPujmKyXXYF88HjFDcq4MxoQVqePQ I2NQa02r5JVb4Y8wOUluAmthaG8x9eyAllJ0Nnd8AqKy6d0eosMowqezmiHmpZcCK2SMxcun82qih GMeTehQkg/E1AZKKId49e+QrzsFeiH3wNXzoTEBPO65qOzcdskHGO3Wz42r6MILIBYaaxEDfFC5k2 8LLotXPzg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvl8-0004cN-Hq; Mon, 29 Jun 2020 15:31:50 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvQl-0002uz-31; Mon, 29 Jun 2020 15:10:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=YsO2bWU2EyT99XrHttqQS4FmFhX52ZtKxcSA05OGLlA=; b=ToxdlF+CeiQVgbkQMI6S1r314j SCHNtRjpQGYOKkv8tKdy2P2O5E3vmVe6B02+fA6fdP7onZkimPXjMEx/VfnVRhNpAAfFXRuTOC/3z gkQiNAiAEwqpQK5Utri7ZYHOl6eijS7Rt91nZxV4+vKQaPQwwaGWFlR5pL04jwQpJUNGvqqjPjspH zD20TYJ95AB24JVgvfwJ4/w4DhrzLIrvYHvDOaMNxEQKkSSXeB2k4bQ1CLmM26kQM4P7ml1weKQvE pm4Hy0lM5zmx6tE0u+yorkvj3cA/XC4qhUp9z8Ua+MlexbixJmWxojsbJfPjfEc+dSSIiw1bbwfET W+OQIR9w==; Received: from mx2.suse.de ([195.135.220.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpvQ7-0003Rf-ES; Mon, 29 Jun 2020 15:10:44 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4D05DAFBE; Mon, 29 Jun 2020 15:10:05 +0000 (UTC) From: Nicolas Saenz Julienne To: gregkh@linuxfoundation.org Subject: [PATCH v2 30/47] staging: vchi: Use struct vchiq_service_params Date: Mon, 29 Jun 2020 17:09:28 +0200 Message-Id: <20200629150945.10720-31-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200629150945.10720-1-nsaenzjulienne@suse.de> References: <20200629150945.10720-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200629_161008_214349_58EB174A X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-4.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, kernel-list@raspberrypi.com, linux-kernel@vger.kernel.org, Nicolas Saenz Julienne , laurent.pinchart@ideasonboard.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org For initialization, vchi has its own params structure, which is then translated to vchiq's params structure. They are essentially the same, so lets directly use vchiq's. Signed-off-by: Nicolas Saenz Julienne --- .../bcm2835-audio/bcm2835-vchiq.c | 9 +++++---- .../vc04_services/interface/vchi/vchi.h | 19 +------------------ .../interface/vchiq_arm/vchiq_shim.c | 12 ++---------- .../vc04_services/vchiq-mmal/mmal-vchiq.c | 11 ++++++----- 4 files changed, 14 insertions(+), 37 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c index 71750ef891dd..c1537a41a2fe 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c @@ -122,11 +122,12 @@ static int vc_vchi_audio_init(struct vchiq_instance *vchiq_instance, struct bcm2835_audio_instance *instance) { - struct service_creation params = { - .version = VCHI_VERSION_EX(VC_AUDIOSERV_VER, VC_AUDIOSERV_MIN_VER), - .service_id = VC_AUDIO_SERVER_NAME, + struct vchiq_service_params params = { + .version = VC_AUDIOSERV_VER, + .version_min = VC_AUDIOSERV_MIN_VER, + .fourcc = VC_AUDIO_SERVER_NAME, .callback = audio_vchi_callback, - .callback_param = instance, + .userdata = instance, }; int status; diff --git a/drivers/staging/vc04_services/interface/vchi/vchi.h b/drivers/staging/vc04_services/interface/vchi/vchi.h index cb66ea1ffad2..4afa6e9f57c4 100644 --- a/drivers/staging/vc04_services/interface/vchi/vchi.h +++ b/drivers/staging/vc04_services/interface/vchi/vchi.h @@ -8,12 +8,6 @@ * Global defs *****************************************************************************/ -struct vchi_version { - uint32_t version; - uint32_t version_min; -}; -#define VCHI_VERSION_EX(v_, m_) { v_, m_ } - // Macros to manipulate 'FOURCC' values #define MAKE_FOURCC(x) ((int32_t)((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3])) @@ -31,17 +25,6 @@ struct vchi_service { unsigned int handle; }; -// structure used to provide the information needed to open a server or a client -struct service_creation { - struct vchi_version version; - int32_t service_id; - enum vchiq_status (*callback)(enum vchiq_reason reason, - struct vchiq_header *header, - unsigned int handle, - void *bulk_userdata); - void *callback_param; -}; - // Opaque handle for a VCHIQ instance struct vchiq_instance; @@ -64,7 +47,7 @@ extern int32_t vchi_disconnect(struct vchiq_instance *instance); *****************************************************************************/ // Routine to open a named service extern int32_t vchi_service_open(struct vchiq_instance *instance, - struct service_creation *setup, + struct vchiq_service_params *setup, struct vchi_service **service); extern int32_t vchi_get_peer_version(struct vchi_service *service, diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c index fb9fd5fec42c..30083927b33d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c @@ -265,23 +265,15 @@ static void service_free(struct vchi_service *service) } int32_t vchi_service_open(struct vchiq_instance *instance, - struct service_creation *setup, + struct vchiq_service_params *params, struct vchi_service **service) { *service = service_alloc(); if (*service) { - struct vchiq_service_params params; enum vchiq_status status; - memset(¶ms, 0, sizeof(params)); - params.fourcc = setup->service_id; - params.callback = setup->callback; - params.userdata = setup->callback_param; - params.version = setup->version.version; - params.version_min = setup->version.version_min; - - status = vchiq_open_service(instance, ¶ms, + status = vchiq_open_service(instance, params, &((*service)->handle)); if (status != VCHIQ_SUCCESS) { service_free(*service); diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index 2abf0f6664f9..4788bb645dc5 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -1860,11 +1860,12 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) int status; struct vchiq_mmal_instance *instance; static struct vchiq_instance *vchiq_instance; - struct service_creation params = { - .version = VCHI_VERSION_EX(VC_MMAL_VER, VC_MMAL_MIN_VER), - .service_id = VC_MMAL_SERVER_NAME, + struct vchiq_service_params params = { + .version = VC_MMAL_VER, + .version_min = VC_MMAL_MIN_VER, + .fourcc = VC_MMAL_SERVER_NAME, .callback = service_callback, - .callback_param = NULL, + .userdata = NULL, }; /* compile time checks to ensure structure size as they are @@ -1906,7 +1907,7 @@ int vchiq_mmal_init(struct vchiq_mmal_instance **out_instance) mutex_init(&instance->context_map_lock); idr_init_base(&instance->context_map, 1); - params.callback_param = instance; + params.userdata = instance; instance->bulk_wq = alloc_ordered_workqueue("mmal-vchiq", WQ_MEM_RECLAIM);