Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp245196iob; Mon, 2 May 2022 18:22:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaiM8mt1uK3bJGVW6oyLmn+JRN/xOotIiEkEo1Hs4n4XLiHNt2ixRlZwHs2faa+CMWgELd X-Received: by 2002:a17:90a:6d96:b0:1c9:c1de:ef2f with SMTP id a22-20020a17090a6d9600b001c9c1deef2fmr2106827pjk.210.1651540927692; Mon, 02 May 2022 18:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651540927; cv=none; d=google.com; s=arc-20160816; b=RF7qfvwaW1RMxK5VL81Q33ebUlOjeLNQ8FOGGs4R4N9z1wuHsMZiPehAs8xRG/rE69 LYEykIwX2p97r8960n0zNroooWzs0ECrLAUnYLlwKhnSKx8tfTqBJzY7kuC1qJQXxDCe fE7mKNn/Luy9izGn3pLPUgRC/DGQ+E2qse0sDZZF0IXhsPMnkppyPc4GDT6IPdnslGw4 4Z6zHmuEWzskN+dXV8NDCuVa1KaUb2+dyhWbAYP6IJ9uFdO5cwksDIoutTOadcVF/bct /sonj3kPf3xNMGywoG8jNn15voM9no9QhRt2DGw4/OzyjR07bcG68PL90D8oXr9Iex0D g5Jw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2jB/3zr/hOAAqCnoexjZJZZ3VWJxDNXF2l2/CCgwTtU=; b=k4Pz9289Ng6qaunxTeV3sHKnjmDnyT7evPQnk8ktahMauG7W6v32uchem0NOVBjytr o1Z3FI5MjBQ8ktH3+ClCV30b4v7o9xJKRJhZNKnjtFQPSMFbTJJDE2WEtYh1FMx+Uq4m ZyePIACIvRdOL7CCd7B5EkRkJDrWzPriF5i5WguKNnVZwDS3t4m37KCRJIiGD0B3hieq hIVqmMI5ehaq2dQ8SlNNdpggczV37QT1FDA9BdMuGve3SvQlts6nODM3Aj8ggSbeLJs6 pwJo37sYQXiMYqmpAoGM0FW5kk0FPV3Eum7UlVYUbhXo2FPrWnENYwh+GkWiMZcrj3ub utJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NP9UcBOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c19-20020aa78e13000000b0050e01cd969dsi1760579pfr.244.2022.05.02.18.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:22:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NP9UcBOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D2C5166C9A; Mon, 2 May 2022 18:01:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386894AbiEBSeb (ORCPT + 99 others); Mon, 2 May 2022 14:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386896AbiEBSeZ (ORCPT ); Mon, 2 May 2022 14:34:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7F326160 for ; Mon, 2 May 2022 11:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651516253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2jB/3zr/hOAAqCnoexjZJZZ3VWJxDNXF2l2/CCgwTtU=; b=NP9UcBOHUelFC7R+NAfmfV5eejjwMv1iJgSk6FNPuq70IqkJLF4ayv75ER+ijxEwQ5W/li usmfNsNCf4isrJ3YhzmQ7Iw8W8l0lMZ6p/dcI28/HFRR2ECkU40SyWTNaBR7AN9VHSgeBF r/ylh7VIk8LBnFm+L1cvi9oTRwsqS88= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-604-tUPB_VM9Mr2sRok-O7lYKQ-1; Mon, 02 May 2022 14:30:52 -0400 X-MC-Unique: tUPB_VM9Mr2sRok-O7lYKQ-1 Received: by mail-qv1-f72.google.com with SMTP id p3-20020a05621421e300b004562c4a6b08so11660755qvj.3 for ; Mon, 02 May 2022 11:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2jB/3zr/hOAAqCnoexjZJZZ3VWJxDNXF2l2/CCgwTtU=; b=IqLN+POMqmZX3Qwvo7MAVrWDw0OlcYm0lBfdI92VSL+sX7PC7BD5YsmTOdy1Rb/Tek nwQ0awsb62fvH7i6UGzcCl0h/EWrjYT4t51MpLRO7CDlGpVuEhvKPJH04+frciaNFTMm gqZYfOOcnUbdh+JTZH90fhYT7VhLEMtR57+PjC+0Vo96J6mS/7IBemNmU9CXHPPtP/j5 O7a+Ot7fP47XeELgd0iuIB2pWx40NzM1y0E112FR88k4TtqhisebSTklXiS44nkrqJew wzzh6FNTN+jkggGilIkLVEQ6t7YRnejhH7OW5iMV+9QTVfhJa6KL6yPNG+z6m5d9yFwT GErg== X-Gm-Message-State: AOAM533F56334rNvNElykn+7cclIqd7aF3vpeHg92ZtomS27XmweCo77 BHpf2+zHQcG9AQ99ajKx1cDjAY5OqZ/l3D4yr1OdZmT0VnokbXnLbeK9DwpmmnFMbUWZkPJfgAy V1X5R9cxiKiWVjBdjuDvIvPJn X-Received: by 2002:a05:620a:1902:b0:5f1:8f5d:b0f2 with SMTP id bj2-20020a05620a190200b005f18f5db0f2mr9595652qkb.60.1651516252190; Mon, 02 May 2022 11:30:52 -0700 (PDT) X-Received: by 2002:a05:620a:1902:b0:5f1:8f5d:b0f2 with SMTP id bj2-20020a05620a190200b005f18f5db0f2mr9595627qkb.60.1651516251874; Mon, 02 May 2022 11:30:51 -0700 (PDT) Received: from fedora.hitronhub.home (modemcable200.11-22-96.mc.videotron.ca. [96.22.11.200]) by smtp.gmail.com with ESMTPSA id h12-20020ac846cc000000b002f39b99f68esm4412204qto.40.2022.05.02.11.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 11:30:51 -0700 (PDT) From: Adrien Thierry To: Nicolas Saenz Julienne , Greg Kroah-Hartman Cc: Adrien Thierry , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] staging: vchiq_arm: add reference to vchiq device in vchiq_state Date: Mon, 2 May 2022 14:30:40 -0400 Message-Id: <20220502183045.206519-2-athierry@redhat.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220502183045.206519-1-athierry@redhat.com> References: <20220502183045.206519-1-athierry@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Add a reference to the vchiq device in the vchiq_state structure. This allows the device structure to be passed around, which will be useful in order to get rid of the global g_dev structure. Signed-off-by: Adrien Thierry --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 2 +- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 4 +++- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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 0596ac61e286..e6e0737c85fc 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -519,7 +519,7 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state) *(char **)&g_fragments_base[i * g_fragments_size] = NULL; sema_init(&g_free_fragments_sema, MAX_FRAGMENTS); - err = vchiq_init_state(state, vchiq_slot_zero); + err = vchiq_init_state(state, vchiq_slot_zero, dev); if (err) return err; diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index 8f99272dbd6f..0d5c39d7c6e2 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2142,7 +2142,7 @@ vchiq_init_slots(void *mem_base, int mem_size) } int -vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) +vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero, struct device *dev) { struct vchiq_shared_state *local; struct vchiq_shared_state *remote; @@ -2169,6 +2169,8 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero) memset(state, 0, sizeof(struct vchiq_state)); + state->dev = dev; + /* * initialize shared state pointers */ diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index 82b7bd7b54b2..352017ff5309 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -315,6 +315,7 @@ struct vchiq_slot_zero { }; struct vchiq_state { + struct device *dev; int id; int initialised; enum vchiq_connstate conn_state; @@ -458,7 +459,7 @@ extern struct vchiq_slot_zero * vchiq_init_slots(void *mem_base, int mem_size); extern int -vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero); +vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero, struct device *dev); extern enum vchiq_status vchiq_connect_internal(struct vchiq_state *state, struct vchiq_instance *instance); -- 2.35.1