2022-12-19 17:44:17

by Hanna Hawa

[permalink] [raw]
Subject: [PATCH 1/1] i2c: designware: fix i2c_dw_clk_rate() return size to be u32

Make i2c_dw_clk_rate() to return u32 instead of unsigned long, as the
function return the value of get_clk_rate_khz() which returns u32.

Fixes: b33af11de236 ("i2c: designware: Do not require clock when SSCN and FFCN are provided")
Signed-off-by: Hanna Hawa <[email protected]>
---
drivers/i2c/busses/i2c-designware-common.c | 2 +-
drivers/i2c/busses/i2c-designware-core.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index c023b691441e..e0a46dfd1c15 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -462,7 +462,7 @@ void __i2c_dw_disable(struct dw_i2c_dev *dev)
dev_warn(dev->dev, "timeout in disabling adapter\n");
}

-unsigned long i2c_dw_clk_rate(struct dw_i2c_dev *dev)
+u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
{
/*
* Clock is not necessary if we got LCNT/HCNT values directly from
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 4d3a3b464ecd..56a029da448a 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -322,7 +322,7 @@ int i2c_dw_init_regmap(struct dw_i2c_dev *dev);
u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset);
u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset);
int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev);
-unsigned long i2c_dw_clk_rate(struct dw_i2c_dev *dev);
+u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev);
int i2c_dw_prepare_clk(struct dw_i2c_dev *dev, bool prepare);
int i2c_dw_acquire_lock(struct dw_i2c_dev *dev);
void i2c_dw_release_lock(struct dw_i2c_dev *dev);
--
2.38.1


2022-12-20 11:19:28

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH 1/1] i2c: designware: fix i2c_dw_clk_rate() return size to be u32

On Mon, Dec 19, 2022 at 05:23:45PM +0000, Hanna Hawa wrote:
> Make i2c_dw_clk_rate() to return u32 instead of unsigned long, as the
> function return the value of get_clk_rate_khz() which returns u32.

Makes sense.
Reviewed-by: Andy Shevchenko <[email protected]>

> Fixes: b33af11de236 ("i2c: designware: Do not require clock when SSCN and FFCN are provided")
> Signed-off-by: Hanna Hawa <[email protected]>
> ---
> drivers/i2c/busses/i2c-designware-common.c | 2 +-
> drivers/i2c/busses/i2c-designware-core.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
> index c023b691441e..e0a46dfd1c15 100644
> --- a/drivers/i2c/busses/i2c-designware-common.c
> +++ b/drivers/i2c/busses/i2c-designware-common.c
> @@ -462,7 +462,7 @@ void __i2c_dw_disable(struct dw_i2c_dev *dev)
> dev_warn(dev->dev, "timeout in disabling adapter\n");
> }
>
> -unsigned long i2c_dw_clk_rate(struct dw_i2c_dev *dev)
> +u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
> {
> /*
> * Clock is not necessary if we got LCNT/HCNT values directly from
> diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
> index 4d3a3b464ecd..56a029da448a 100644
> --- a/drivers/i2c/busses/i2c-designware-core.h
> +++ b/drivers/i2c/busses/i2c-designware-core.h
> @@ -322,7 +322,7 @@ int i2c_dw_init_regmap(struct dw_i2c_dev *dev);
> u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset);
> u32 i2c_dw_scl_lcnt(u32 ic_clk, u32 tLOW, u32 tf, int offset);
> int i2c_dw_set_sda_hold(struct dw_i2c_dev *dev);
> -unsigned long i2c_dw_clk_rate(struct dw_i2c_dev *dev);
> +u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev);
> int i2c_dw_prepare_clk(struct dw_i2c_dev *dev, bool prepare);
> int i2c_dw_acquire_lock(struct dw_i2c_dev *dev);
> void i2c_dw_release_lock(struct dw_i2c_dev *dev);
> --
> 2.38.1
>

--
With Best Regards,
Andy Shevchenko


2022-12-20 13:14:23

by Jarkko Nikula

[permalink] [raw]
Subject: Re: [PATCH 1/1] i2c: designware: fix i2c_dw_clk_rate() return size to be u32

On 12/20/22 12:48, Andy Shevchenko wrote:
> On Mon, Dec 19, 2022 at 05:23:45PM +0000, Hanna Hawa wrote:
>> Make i2c_dw_clk_rate() to return u32 instead of unsigned long, as the
>> function return the value of get_clk_rate_khz() which returns u32.
>
> Makes sense.
> Reviewed-by: Andy Shevchenko <[email protected]>
>
Acked-by: Jarkko Nikula <[email protected]>

2023-01-09 12:33:09

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH 1/1] i2c: designware: fix i2c_dw_clk_rate() return size to be u32

On Mon, Dec 19, 2022 at 05:23:45PM +0000, Hanna Hawa wrote:
> Make i2c_dw_clk_rate() to return u32 instead of unsigned long, as the
> function return the value of get_clk_rate_khz() which returns u32.
>
> Fixes: b33af11de236 ("i2c: designware: Do not require clock when SSCN and FFCN are provided")
> Signed-off-by: Hanna Hawa <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (388.00 B)
signature.asc (849.00 B)
Download all attachments