* [PATCH v2] i2c: qcom-cci: simplify access to bus data structure
@ 2022-06-02 16:52 Vladimir Zapolskiy
2022-06-02 18:02 ` Loic Poulain
2022-06-08 20:10 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Vladimir Zapolskiy @ 2022-06-02 16:52 UTC (permalink / raw)
To: Loic Poulain, Robert Foss; +Cc: linux-i2c, linux-arm-msm
Trivial non-functional change, which adds an alias to an extensively
used data location.
Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
---
Changes from v1 to v2:
* removed a wrapped line, thanks to review by Loic.
drivers/i2c/busses/i2c-qcom-cci.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index 8d078bdb5c1b..f6a1de575c5a 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -541,6 +541,7 @@ static int cci_probe(struct platform_device *pdev)
return -ENOENT;
for_each_available_child_of_node(dev->of_node, child) {
+ struct cci_master *master;
u32 idx;
ret = of_property_read_u32(child, "reg", &idx);
@@ -555,27 +556,27 @@ static int cci_probe(struct platform_device *pdev)
continue;
}
- cci->master[idx].adap.quirks = &cci->data->quirks;
- cci->master[idx].adap.algo = &cci_algo;
- cci->master[idx].adap.dev.parent = dev;
- cci->master[idx].adap.dev.of_node = of_node_get(child);
- cci->master[idx].master = idx;
- cci->master[idx].cci = cci;
+ master = &cci->master[idx];
+ master->adap.quirks = &cci->data->quirks;
+ master->adap.algo = &cci_algo;
+ master->adap.dev.parent = dev;
+ master->adap.dev.of_node = of_node_get(child);
+ master->master = idx;
+ master->cci = cci;
- i2c_set_adapdata(&cci->master[idx].adap, &cci->master[idx]);
- snprintf(cci->master[idx].adap.name,
- sizeof(cci->master[idx].adap.name), "Qualcomm-CCI");
+ i2c_set_adapdata(&master->adap, master);
+ snprintf(master->adap.name, sizeof(master->adap.name), "Qualcomm-CCI");
- cci->master[idx].mode = I2C_MODE_STANDARD;
+ master->mode = I2C_MODE_STANDARD;
ret = of_property_read_u32(child, "clock-frequency", &val);
if (!ret) {
if (val == I2C_MAX_FAST_MODE_FREQ)
- cci->master[idx].mode = I2C_MODE_FAST;
+ master->mode = I2C_MODE_FAST;
else if (val == I2C_MAX_FAST_MODE_PLUS_FREQ)
- cci->master[idx].mode = I2C_MODE_FAST_PLUS;
+ master->mode = I2C_MODE_FAST_PLUS;
}
- init_completion(&cci->master[idx].irq_complete);
+ init_completion(&master->irq_complete);
}
/* Memory */
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i2c: qcom-cci: simplify access to bus data structure
2022-06-02 16:52 [PATCH v2] i2c: qcom-cci: simplify access to bus data structure Vladimir Zapolskiy
@ 2022-06-02 18:02 ` Loic Poulain
2022-06-08 20:10 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Loic Poulain @ 2022-06-02 18:02 UTC (permalink / raw)
To: Vladimir Zapolskiy; +Cc: Robert Foss, linux-i2c, linux-arm-msm
On Thu, 2 Jun 2022 at 18:53, Vladimir Zapolskiy
<vladimir.zapolskiy@linaro.org> wrote:
>
> Trivial non-functional change, which adds an alias to an extensively
> used data location.
>
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
> ---
> Changes from v1 to v2:
> * removed a wrapped line, thanks to review by Loic.
>
> drivers/i2c/busses/i2c-qcom-cci.c | 27 ++++++++++++++-------------
> 1 file changed, 14 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
> index 8d078bdb5c1b..f6a1de575c5a 100644
> --- a/drivers/i2c/busses/i2c-qcom-cci.c
> +++ b/drivers/i2c/busses/i2c-qcom-cci.c
> @@ -541,6 +541,7 @@ static int cci_probe(struct platform_device *pdev)
> return -ENOENT;
>
> for_each_available_child_of_node(dev->of_node, child) {
> + struct cci_master *master;
> u32 idx;
>
> ret = of_property_read_u32(child, "reg", &idx);
> @@ -555,27 +556,27 @@ static int cci_probe(struct platform_device *pdev)
> continue;
> }
>
> - cci->master[idx].adap.quirks = &cci->data->quirks;
> - cci->master[idx].adap.algo = &cci_algo;
> - cci->master[idx].adap.dev.parent = dev;
> - cci->master[idx].adap.dev.of_node = of_node_get(child);
> - cci->master[idx].master = idx;
> - cci->master[idx].cci = cci;
> + master = &cci->master[idx];
> + master->adap.quirks = &cci->data->quirks;
> + master->adap.algo = &cci_algo;
> + master->adap.dev.parent = dev;
> + master->adap.dev.of_node = of_node_get(child);
> + master->master = idx;
> + master->cci = cci;
>
> - i2c_set_adapdata(&cci->master[idx].adap, &cci->master[idx]);
> - snprintf(cci->master[idx].adap.name,
> - sizeof(cci->master[idx].adap.name), "Qualcomm-CCI");
> + i2c_set_adapdata(&master->adap, master);
> + snprintf(master->adap.name, sizeof(master->adap.name), "Qualcomm-CCI");
>
> - cci->master[idx].mode = I2C_MODE_STANDARD;
> + master->mode = I2C_MODE_STANDARD;
> ret = of_property_read_u32(child, "clock-frequency", &val);
> if (!ret) {
> if (val == I2C_MAX_FAST_MODE_FREQ)
> - cci->master[idx].mode = I2C_MODE_FAST;
> + master->mode = I2C_MODE_FAST;
> else if (val == I2C_MAX_FAST_MODE_PLUS_FREQ)
> - cci->master[idx].mode = I2C_MODE_FAST_PLUS;
> + master->mode = I2C_MODE_FAST_PLUS;
> }
>
> - init_completion(&cci->master[idx].irq_complete);
> + init_completion(&master->irq_complete);
> }
>
> /* Memory */
> --
> 2.33.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] i2c: qcom-cci: simplify access to bus data structure
2022-06-02 16:52 [PATCH v2] i2c: qcom-cci: simplify access to bus data structure Vladimir Zapolskiy
2022-06-02 18:02 ` Loic Poulain
@ 2022-06-08 20:10 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2022-06-08 20:10 UTC (permalink / raw)
To: Vladimir Zapolskiy; +Cc: Loic Poulain, Robert Foss, linux-i2c, linux-arm-msm
[-- Attachment #1: Type: text/plain, Size: 271 bytes --]
On Thu, Jun 02, 2022 at 07:52:58PM +0300, Vladimir Zapolskiy wrote:
> Trivial non-functional change, which adds an alias to an extensively
> used data location.
>
> Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-08 20:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-02 16:52 [PATCH v2] i2c: qcom-cci: simplify access to bus data structure Vladimir Zapolskiy
2022-06-02 18:02 ` Loic Poulain
2022-06-08 20:10 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).