[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230911-topic-mars-v1-16-a7d38bf87bdb@linaro.org>
Date: Mon, 11 Sep 2023 17:10:30 +0200
From: Konrad Dybcio <konrad.dybcio@...aro.org>
To: Stanimir Varbanov <stanimir.k.varbanov@...il.com>,
Vikash Garodia <quic_vgarodia@...cinc.com>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Dikshita Agarwal <quic_dikshita@...cinc.com>,
Philipp Zabel <p.zabel@...gutronix.de>
Cc: Marijn Suijten <marijn.suijten@...ainline.org>,
Stanimir Varbanov <stanimir.varbanov@...aro.org>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Konrad Dybcio <konrad.dybcio@...aro.org>
Subject: [PATCH RFT 16/20] media: venus: core: Define a pointer to
core->res
To make the code more concise, define a new variable 'res' pointing to
the abundantly referenced core->res.
Signed-off-by: Konrad Dybcio <konrad.dybcio@...aro.org>
---
drivers/media/platform/qcom/venus/core.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 9a1b0be5d067..435f6f10a905 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -283,6 +283,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;
@@ -313,9 +314,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;
@@ -323,14 +326,14 @@ static int venus_probe(struct platform_device *pdev)
if (ret)
return ret;
- core->resets = devm_kcalloc(dev, core->res->resets_num, sizeof(*core->resets), GFP_KERNEL);
- if (core->res->resets_num && !core->resets)
+ core->resets = devm_kcalloc(dev, res->resets_num, sizeof(*core->resets), GFP_KERNEL);
+ if (res->resets_num && !core->resets)
return -ENOMEM;
- for (i = 0; i < core->res->resets_num; i++)
- core->resets[i].id = core->res->resets[i];
+ for (i = 0; i < res->resets_num; i++)
+ core->resets[i].id = res->resets[i];
- ret = devm_reset_control_bulk_get_exclusive(dev, core->res->resets_num, core->resets);
+ ret = devm_reset_control_bulk_get_exclusive(dev, res->resets_num, core->resets);
if (ret)
return ret;
@@ -340,7 +343,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.42.0
Powered by blists - more mailing lists