[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <mzuqdxb2dthfg6xa5jhodj6d54b6zlcnby35hmxe4jvfw3oghm@uunqpeg5wcdd>
Date: Fri, 5 Jul 2024 00:30:19 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Claudiu <claudiu.beznea@...on.dev>
Cc: chris.brandt@...esas.com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, geert+renesas@...der.be, magnus.damm@...il.com,
mturquette@...libre.com, sboyd@...nel.org, p.zabel@...gutronix.de,
wsa+renesas@...g-engineering.com, linux-renesas-soc@...r.kernel.org, linux-i2c@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH v2 02/12] i2c: riic: Use temporary variable for struct
device
Hi Claudiu,
...
> Use a temporary variable for the struct device pointers to avoid
> dereferencing.
So far just refactoring...
> While at it, replace riic->adapter.dev argument of
> dev_err() from riic_init_hw() with the temporary variable (pointing to
> riic->adapter.dev.parent).
This is the real change in this patch and you are not explaining
why you did it.
...
> @@ -303,11 +304,12 @@ static int riic_init_hw(struct riic_dev *riic, struct i2c_timings *t)
> int ret = 0;
> unsigned long rate;
> int total_ticks, cks, brl, brh;
> + struct device *dev = riic->adapter.dev.parent;
>
> - pm_runtime_get_sync(riic->adapter.dev.parent);
> + pm_runtime_get_sync(dev);
>
> if (t->bus_freq_hz > I2C_MAX_FAST_MODE_FREQ) {
> - dev_err(&riic->adapter.dev,
> + dev_err(dev,
> "unsupported bus speed (%dHz). %d max\n",
> t->bus_freq_hz, I2C_MAX_FAST_MODE_FREQ);
I personally prefer the reference to the current device, it's
more traceable. If you think it's not providing enough
information, then you can improve it, but I wouldn't like to lose
reference to this driver in the log.
Andi
Powered by blists - more mailing lists