Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp227233lqo; Wed, 27 Mar 2024 11:13:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVhAtTpiZVmZzSYMqt3BFZVo4Uqcn5rvGFQFffSr0T0h1QOUC4mVljLMEpoKTT06O10kAX6Y991s9WwySvZdkFJdE5Q7Oo4hip8WBI6jQ== X-Google-Smtp-Source: AGHT+IEPOxsef/aG9e5etZiUkoiYwsTaq2rhFuKqGJugi2JLSssRP8ToszLzoMFZXbNZGvDMLiIQ X-Received: by 2002:a17:90b:4b87:b0:29f:66e2:d2a6 with SMTP id lr7-20020a17090b4b8700b0029f66e2d2a6mr446263pjb.26.1711563228636; Wed, 27 Mar 2024 11:13:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711563228; cv=pass; d=google.com; s=arc-20160816; b=v3fOkrkZ+a3H8C8gcOIaixDz2FBy4CRpRpvrimlD/aXLlSYblrkfwDtqsaJj95s0k+ lczA09UJjuirGi6p1KlZ6OUnO2x0HVB2KNjCKxuZgtqlUsliotXcvxk0iRnr6dixZuW/ slrakiYVJcsOnYAFRqvhqlR5npbeeTVDe7i5+syTjnh8UkGCmf5aoLpjVN6idaxy7F0u B2KbBqzeLJmBrJmyVq7vJefuBmXkvaqSHCXt299wKoNWFzgiOaLIHLFuhtdQV54ufJp4 hjdh+YGshJUGfyOQuD+O2LLzEEKuXmMsH3PuEyfjxaFrfNlBaHFDnLV07Ys2krxgdcMS Ql1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=X/CQd/17iJ2kwXZI1u99C8d+fll4NuRn/euAOmsXPlU=; fh=RlcPkmzcmkWekb7XVDvQ+fX0utP3HLoD19nx0rk+a8M=; b=bQXzj9FN1tQdq7i+gSV54j4nF/BIeMKWdVAnA/8LoJmFZVHDOliN+cR0FDkvAPxKzz cY2yXvUGjJe1io8o2aOBmabl5+07oey6cIt4GByfexdaeAUMIfWsr5D+UNo90tMrjAgl FW08CGd+IAgW8aQ/pFE3ttmnHPlo9ffYB2oY3FV3vYAUsuh4nyRnU5ezLAJE69iCdIDF /8CvAm7RPT9dqlqdi+jfYyrQAby/1F8HNOPfrXBIddHN84ZhENul31usurucJxm/wrLE D4lVod9woPaev2ZbA9erl0QW8r7Ar/FZuD/pu+6UDVVZTHXeycsCY/rtydFsJ7NzL/kD a3iw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nLpe09sy; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-121800-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ds11-20020a17090b08cb00b002a08781be03si1866335pjb.89.2024.03.27.11.13.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 11:13:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121800-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nLpe09sy; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-121800-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121800-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8AA422A2C30 for ; Wed, 27 Mar 2024 18:13:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 189D0153823; Wed, 27 Mar 2024 18:09:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="nLpe09sy" Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A6BA153827 for ; Wed, 27 Mar 2024 18:09:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711562956; cv=none; b=O6DDoBgxG365Fl3aFABokzmfww0jYTCa8PKbijpwFjjYAcmfAcv8fqDJCsX3mGFVQnOGw9nKWorQQF/GCRrjC558a+gKGDW4RBmQGxUZBpY2nXzws3WHImsnEZuBaavIOL1qJDbWseFsUeQAYyxS7rWLgW9tQGefcIQrVm6TTIo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711562956; c=relaxed/simple; bh=N/+DdFoVCHF23AQ+OjDZ00SaK75sELYmsLPOH0p2aT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PtfmK2BeAdTtkby3+8x0rDJaBNasnb53HPctvtYmcF5r/SsT6GBaD76bBgoCzFoUg0e2o+wAf9UzmNBwzsC5biwiqL0bb1vjDSpWAPRSyH5H6TxA9OXeCMu6fdLOoeVL0IvMuF9c2v2nQjJ2EJYUVepfOl2ZgaW1vVFnpneeVpQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=nLpe09sy; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a4dfe6564b6so13358166b.3 for ; Wed, 27 Mar 2024 11:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711562953; x=1712167753; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=X/CQd/17iJ2kwXZI1u99C8d+fll4NuRn/euAOmsXPlU=; b=nLpe09syAhOCWd9tQd+MwornteZb8fNr5WtkOEhJGMVdkuksIVwiE0gddSqAuOe+1B gVL4sQE3VZj/f9sNWnSZcz6rmCvZ+6vF0Zgt//X+0KT/oxbro5QATKyq0DDgbi7I/67X ICc71XRNgOG9avnZ8+Aw+xWLbSNAL0QW0SiMqCN4UlXucWDnkZXqN3G4KHtzF5lEUveJ ZIIxIzD3uCNBYA6zjCPdQK0wt42Km/LXj0EZbymsC6Jw59Mb/vVcMGlQAYaofAjzJAy3 m0lhGonDUAv7jG54pe6PgwYADePQ8Ojeov2GGT9uTI0BCAgCkAsv7YBcGFBk/AAilmrJ ln/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711562953; x=1712167753; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X/CQd/17iJ2kwXZI1u99C8d+fll4NuRn/euAOmsXPlU=; b=jhqOwsxHQOB5uh2RLQ5vfCWP89uDzxq/PHi8+UEFtUlRdMiRGsB3U+J5O0WqoobR8O M8J7kOPNgAXHeQwakQr2oqOaKUDo2CRc+k2ttwrJC87iOhQhQcfNCp556yyxvdPesVaR ZiKDYK1L3ZQx8V5EUZZzv5Tsz8atpCCz8wLw9j7UO2vBXfNmm9xutF0xYsatKY8k37b5 dGSiRFgBpw3gYIVWsh9qynN6gZzyNx8480oiGuznwgAM6cYm21IQVG04mlVCagW+7ALJ KnjwFitbqGT2aAxXALzJR2eDdB7WF4AGJGV2uXgiNyFel2SSSJ7He0vfz794LrbJ9XFT APWA== X-Forwarded-Encrypted: i=1; AJvYcCVKO6q2YRcvXgTNa1G4kvERbG7mHlslQHMRcKIa0sCqc+5sICj0uNGbaEC05lGQLVbPJNFh69ShnTBgQCW6xJD8/W+4EzRcx3O/nQg4 X-Gm-Message-State: AOJu0YwCNVqYuBVgFQ3xHXSQkr9qgrmpUbkpC8pi8hvV0CRdxHDM0DTv D/UzcvHchChz7SZUCsS32VXl9UW2au6u6+v/sMs5yWw9KQzhdx6nCZO0/suSnTM= X-Received: by 2002:a17:906:3c51:b0:a46:e595:f357 with SMTP id i17-20020a1709063c5100b00a46e595f357mr189730ejg.9.1711562953062; Wed, 27 Mar 2024 11:09:13 -0700 (PDT) Received: from [192.168.92.47] (078088045141.garwolin.vectranet.pl. [78.88.45.141]) by smtp.gmail.com with ESMTPSA id z2-20020a1709060be200b00a45f2dc6795sm5702733ejg.137.2024.03.27.11.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 11:09:12 -0700 (PDT) From: Konrad Dybcio Date: Wed, 27 Mar 2024 19:08:52 +0100 Subject: [PATCH v3 14/19] media: venus: core: Define a pointer to core->res Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230911-topic-mars-v3-14-79f23b81c261@linaro.org> References: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> In-Reply-To: <20230911-topic-mars-v3-0-79f23b81c261@linaro.org> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Dikshita Agarwal , Philipp Zabel Cc: Marijn Suijten , Stanimir Varbanov , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711562924; l=1808; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=N/+DdFoVCHF23AQ+OjDZ00SaK75sELYmsLPOH0p2aT4=; b=1gxBTxoz/cxrMX0RUDFm+MPnu8jLxtNwBQRjFbmiKwfrMWSZ2mUQ6GbUHNJot8qeaX5xQ5sw6 0G9hX+ocBcYALouuYtXDuLwShrMO/8+6DguNAgv1Iz8Lb2t+ZwkTf/2 X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= To make the code more concise, define a new variable 'res' pointing to the abundantly referenced core->res. Signed-off-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 5b18b1f41267..e61aa863b7f7 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -285,6 +285,7 @@ static irqreturn_t venus_isr_thread(int irq, void *dev_id) static int venus_probe(struct platform_device *pdev) { + const struct venus_resources *res; struct device *dev = &pdev->dev; struct venus_core *core; int i, ret; @@ -315,9 +316,11 @@ static int venus_probe(struct platform_device *pdev) if (!core->res) return -ENODEV; + res = core->res; + mutex_init(&core->pm_lock); - core->pm_ops = venus_pm_get(core->res->hfi_version); + core->pm_ops = venus_pm_get(res->hfi_version); if (!core->pm_ops) return -ENODEV; @@ -325,8 +328,8 @@ static int venus_probe(struct platform_device *pdev) if (ret) return ret; - for (i = 0; i < core->res->resets_num; i++) { - core->resets[i] = devm_reset_control_get_exclusive(dev, core->res->resets[i]); + for (i = 0; i < res->resets_num; i++) { + core->resets[i] = devm_reset_control_get_exclusive(dev, res->resets[i]); if (IS_ERR(core->resets[i])) return PTR_ERR(core->resets[i]); } @@ -337,7 +340,7 @@ static int venus_probe(struct platform_device *pdev) return ret; } - ret = dma_set_mask_and_coherent(dev, core->res->dma_mask); + ret = dma_set_mask_and_coherent(dev, res->dma_mask); if (ret) goto err_core_put; -- 2.44.0