diff mbox series

[2/2] i2c: synquacer: Remove a clk reference from struct synquacer_i2c

Message ID 01e5b93d75eaeb071c6864f8b43355a7c24e0c91.1704545258.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series None | expand

Commit Message

Christophe JAILLET Jan. 6, 2024, 12:48 p.m. UTC
'pclk' is only used locally in the probe. Remove it from the
'synquacer_i2c' structure.

Also remove a useless debug message.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/i2c/busses/i2c-synquacer.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Ard Biesheuvel Jan. 12, 2024, 5:50 p.m. UTC | #1
On Sat, 6 Jan 2024 at 13:48, Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> 'pclk' is only used locally in the probe. Remove it from the
> 'synquacer_i2c' structure.
>
> Also remove a useless debug message.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

> ---
>  drivers/i2c/busses/i2c-synquacer.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
> index a73f5bb9a164..e774b9f499b6 100644
> --- a/drivers/i2c/busses/i2c-synquacer.c
> +++ b/drivers/i2c/busses/i2c-synquacer.c
> @@ -138,7 +138,6 @@ struct synquacer_i2c {
>         int                     irq;
>         struct device           *dev;
>         void __iomem            *base;
> -       struct clk              *pclk;
>         u32                     pclkrate;
>         u32                     speed_khz;
>         u32                     timeout_ms;
> @@ -535,6 +534,7 @@ static const struct i2c_adapter synquacer_i2c_ops = {
>  static int synquacer_i2c_probe(struct platform_device *pdev)
>  {
>         struct synquacer_i2c *i2c;
> +       struct clk *pclk;
>         u32 bus_speed;
>         int ret;
>
> @@ -550,13 +550,12 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
>         device_property_read_u32(&pdev->dev, "socionext,pclk-rate",
>                                  &i2c->pclkrate);
>
> -       i2c->pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
> -       if (IS_ERR(i2c->pclk))
> -               return dev_err_probe(&pdev->dev, PTR_ERR(i2c->pclk),
> +       pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
> +       if (IS_ERR(pclk))
> +               return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
>                                      "failed to get and enable clock\n");
>
> -       dev_dbg(&pdev->dev, "clock source %p\n", i2c->pclk);
> -       i2c->pclkrate = clk_get_rate(i2c->pclk);
> +       i2c->pclkrate = clk_get_rate(pclk);
>
>         if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
>             i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)
> --
> 2.34.1
>
Andi Shyti May 6, 2024, 9:04 a.m. UTC | #2
Hi Christophe,

On Sat, Jan 06, 2024 at 01:48:25PM +0100, Christophe JAILLET wrote:
> 'pclk' is only used locally in the probe. Remove it from the
> 'synquacer_i2c' structure.
> 
> Also remove a useless debug message.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied to i2c/i2c-host-next.

Thanks,
Andi
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-synquacer.c b/drivers/i2c/busses/i2c-synquacer.c
index a73f5bb9a164..e774b9f499b6 100644
--- a/drivers/i2c/busses/i2c-synquacer.c
+++ b/drivers/i2c/busses/i2c-synquacer.c
@@ -138,7 +138,6 @@  struct synquacer_i2c {
 	int			irq;
 	struct device		*dev;
 	void __iomem		*base;
-	struct clk		*pclk;
 	u32			pclkrate;
 	u32			speed_khz;
 	u32			timeout_ms;
@@ -535,6 +534,7 @@  static const struct i2c_adapter synquacer_i2c_ops = {
 static int synquacer_i2c_probe(struct platform_device *pdev)
 {
 	struct synquacer_i2c *i2c;
+	struct clk *pclk;
 	u32 bus_speed;
 	int ret;
 
@@ -550,13 +550,12 @@  static int synquacer_i2c_probe(struct platform_device *pdev)
 	device_property_read_u32(&pdev->dev, "socionext,pclk-rate",
 				 &i2c->pclkrate);
 
-	i2c->pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
-	if (IS_ERR(i2c->pclk))
-		return dev_err_probe(&pdev->dev, PTR_ERR(i2c->pclk),
+	pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
+	if (IS_ERR(pclk))
+		return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
 				     "failed to get and enable clock\n");
 
-	dev_dbg(&pdev->dev, "clock source %p\n", i2c->pclk);
-	i2c->pclkrate = clk_get_rate(i2c->pclk);
+	i2c->pclkrate = clk_get_rate(pclk);
 
 	if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
 	    i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)