Re: [PATCH v4 3/3] i2c: jz4780: Use dev_err_probe()
From: Andi Shyti
Date: Mon Sep 09 2024 - 04:25:55 EST
Hi Rong,
On Tue, Aug 27, 2024 at 11:48:41AM GMT, Rong Qianfeng wrote:
> No more special handling needed here, so use dev_err_probe()
> to simplify the code.
>
> While at it, use struct dev *dev to replace &pdev->dev to
> further simplify the code.
>
> Use the macro definition HZ_PER_KHZ to replace the 1000.
>
> Signed-off-by: Rong Qianfeng <rongqianfeng@xxxxxxxx>
> ---
> drivers/i2c/busses/i2c-jz4780.c | 40 ++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
> index 92cc5b091137..72823a0f39c2 100644
> --- a/drivers/i2c/busses/i2c-jz4780.c
> +++ b/drivers/i2c/busses/i2c-jz4780.c
> @@ -23,6 +23,7 @@
> #include <linux/sched.h>
> #include <linux/slab.h>
> #include <linux/time.h>
> +#include <linux/units.h>
>
> #define JZ4780_I2C_CTRL 0x00
> #define JZ4780_I2C_TAR 0x04
> @@ -764,14 +765,15 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
> unsigned int clk_freq = 0;
> unsigned short tmp;
> struct jz4780_i2c *i2c;
> + struct device *dev = &pdev->dev;
I'm not a big fan of this change. There is not much gain in
polluting git bisect in order to shorten pdev->dev to a single
dev.
However, I like the /dev_err/dev_err_probe/.
I will take the first two patches from this series, but I will
leave this if anyone else has a stronger opinion. If you want,
you can send just this one patch with just the dev_err_probe()
change.
Thanks,
Andi