diff mbox series

[v3,2/4] i2c: emev2: drop sclk from struct em_i2c_device

Message ID 20240823035116.21590-3-rongqianfeng@vivo.com
State Superseded
Headers show
Series i2c: Use devm_clk_get_enabled() helpers | expand

Commit Message

Rong Qianfeng Aug. 23, 2024, 3:51 a.m. UTC
For no need to save clk pointer, drop sclk from struct em_i2c_device.

Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 drivers/i2c/busses/i2c-emev2.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Wolfram Sang Aug. 26, 2024, 9:09 a.m. UTC | #1
On Fri, Aug 23, 2024 at 11:51:14AM +0800, Rong Qianfeng wrote:
> For no need to save clk pointer, drop sclk from struct em_i2c_device.
> 
> Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com>
> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>

Should be folded into patch 1 IMO.
Rong Qianfeng Aug. 26, 2024, 9:29 a.m. UTC | #2
在 2024/8/26 17:09, Wolfram Sang 写道:
> On Fri, Aug 23, 2024 at 11:51:14AM +0800, Rong Qianfeng wrote:
>> For no need to save clk pointer, drop sclk from struct em_i2c_device.
>>
>> Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com>
>> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
> Should be folded into patch 1 IMO.
Thanks for taking the time to reply.  Your comments can help me learn more.
I will try to do this in the next version.

---

Best Regards,
Qianfeng
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-emev2.c b/drivers/i2c/busses/i2c-emev2.c
index 20efe0b0cb85..2a5d9d658246 100644
--- a/drivers/i2c/busses/i2c-emev2.c
+++ b/drivers/i2c/busses/i2c-emev2.c
@@ -67,7 +67,6 @@  struct em_i2c_device {
 	void __iomem *base;
 	struct i2c_adapter adap;
 	struct completion msg_done;
-	struct clk *sclk;
 	struct i2c_client *slave;
 	int irq;
 };
@@ -361,6 +360,7 @@  static const struct i2c_algorithm em_i2c_algo = {
 static int em_i2c_probe(struct platform_device *pdev)
 {
 	struct em_i2c_device *priv;
+	struct clk *sclk;
 	int ret;
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
@@ -373,9 +373,9 @@  static int em_i2c_probe(struct platform_device *pdev)
 
 	strscpy(priv->adap.name, "EMEV2 I2C", sizeof(priv->adap.name));
 
-	priv->sclk = devm_clk_get_enabled(&pdev->dev, "sclk");
-	if (IS_ERR(priv->sclk))
-		return PTR_ERR(priv->sclk);
+	sclk = devm_clk_get_enabled(&pdev->dev, "sclk");
+	if (IS_ERR(sclk))
+		return PTR_ERR(sclk);
 
 	priv->adap.timeout = msecs_to_jiffies(100);
 	priv->adap.retries = 5;