From patchwork Mon May 2 18:30:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien Thierry X-Patchwork-Id: 12834624 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 2295FC433EF for ; Mon, 2 May 2022 18:32:21 +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=AnMNiPOchfIbZWCYkH6cbpN81r71kbnRn0St6xxfH6E=; b=cQ1W6FTHACbzp1 japG3ZsMaLkqedeh+iAhnpjnHb8KVj4zCLd3K8+n6b4Gkke5dcCSvpd4+zkZ7j/BQcUmAKol+kjUl pO1/1blgdY9p19P9H/UiJDiCiYv88J3FBS0FsuJj/F/GOJEszKW/QjjlDLyflBUx5MZtIDGIXfW4z jeqcKCjiDuHhVKNxA6raBusT60Pj2GgJdcKvRNUzpIrlvw/r75xfj2I4Oown4NkJABXaTnjYIX7WD fRm7GDjeoiMHzUmrXsRAWNsY4wfSIR/9Vsm8XeChgQeycrGVndDhJyo7Aa9FsuKPZ732s9vBnxSOK BhiV/ztuIoFHTHm1yjBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlapB-002CMd-AE; Mon, 02 May 2022 18:31:09 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nlaoz-002CHc-1W for linux-arm-kernel@lists.infradead.org; Mon, 02 May 2022 18:30:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651516256; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2jB/3zr/hOAAqCnoexjZJZZ3VWJxDNXF2l2/CCgwTtU=; b=i2vYQ1toWSS96xmGsPxxO677uv0SMlwkppDopZzYYAwEgRstxpXMdxiCoTAkOhv3OK6tfh XaU/E0G3/1KyLc8PU0ZDlm+LPqGU4tjaBMDvqIHTOz8ys0vXWmkPnAOtiVsp1KYo1dRaEg i8FnEEM//tT2gv/HabThsn7c7JT41fk= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-121-gfCvRwS1Ov27Gh9Ar3wOBg-1; Mon, 02 May 2022 14:30:53 -0400 X-MC-Unique: gfCvRwS1Ov27Gh9Ar3wOBg-1 Received: by mail-qk1-f198.google.com with SMTP id 17-20020a370511000000b0069fd3b67d95so3034642qkf.6 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=jKCD8DDgepubLPIh8oYnNcXLcwBwvzXkQLfugvCalrq1lpjS/Mt8/osuMVfC9pP1Da o7mhRLVuqwkarFfa7CeU1LfCuRvaej3aCBDzBdHqNYt6G1C+eLYbqvSxrgeOBNqrSEk5 hqKeAVOnpPMUpuKBsiqOn29UL3o0kx8Rl3KfA5Etu1RGUoZ/wQN44/dBNZRLAny8LUJQ 5HlbCOsxr5iNW+VpLXoB4FQ4ubDrzfEKw1WcRr++6jP/DghpZDDkubGy/hcrz+Go7IJE c28RJTlx3w3Pyhs2NLWEJiEaLDBmqUA+bJ2Pz83j5/n2j012vGr3p3xrOiXgY4D/XhlQ 1gTw== X-Gm-Message-State: AOAM533zoiyxWa0jmJjil6odqYDl/z8eecxZDCP4csai0fJydGw9/Kv5 ip/AP3++fX2MPO7ezREl/y3XlbSUsB0PhJUSkVIs06fG9jGoSdtQSP1tMvb1BsDYc3FJ7wGw/eW J0dXdCqgwlL9E8YAsZVYtukepLrnH6whcNTY= X-Received: by 2002:a05:620a:1902:b0:5f1:8f5d:b0f2 with SMTP id bj2-20020a05620a190200b005f18f5db0f2mr9595654qkb.60.1651516252198; Mon, 02 May 2022 11:30:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3CJBU92TjpturzqseBQ/Q0w/mIcCijpWAzznSsZQjXuIVQUluXrP1ZKrWbC/jmzJriC7Z4w== 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=athierry@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220502_113057_183842_2AD87CF5 X-CRM114-Status: GOOD ( 16.08 ) 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 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);