Skip to content

Commit df576be

Browse files
Wolfram SangWolfram Sang
authored andcommitted
i2c: rcar: clean up after refactoring i2c_timings
The pointer is not really needed anymore since we have the timings struct available in the function itself now. Remove the pointer and access the struct directly. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 624d1be commit df576be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/i2c/busses/i2c-rcar.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,15 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv)
240240
u32 scgd, cdf, round, ick, sum, scl, cdf_width;
241241
unsigned long rate;
242242
struct device *dev = rcar_i2c_priv_to_dev(priv);
243-
struct i2c_timings i2c_t = {
243+
struct i2c_timings t = {
244244
.bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ,
245245
.scl_fall_ns = 35,
246246
.scl_rise_ns = 200,
247247
.scl_int_delay_ns = 50,
248-
}, *t = &i2c_t;
248+
};
249249

250250
/* Fall back to previously used values if not supplied */
251-
i2c_parse_fw_timings(dev, &i2c_t, false);
251+
i2c_parse_fw_timings(dev, &t, false);
252252

253253
switch (priv->devtype) {
254254
case I2C_RCAR_GEN1:
@@ -294,7 +294,7 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv)
294294
* = F[sum * ick / 1000000000]
295295
* = F[(ick / 1000000) * sum / 1000]
296296
*/
297-
sum = t->scl_fall_ns + t->scl_rise_ns + t->scl_int_delay_ns;
297+
sum = t.scl_fall_ns + t.scl_rise_ns + t.scl_int_delay_ns;
298298
round = (ick + 500000) / 1000000 * sum;
299299
round = (round + 500) / 1000;
300300

@@ -312,15 +312,15 @@ static int rcar_i2c_clock_calculate(struct rcar_i2c_priv *priv)
312312
*/
313313
for (scgd = 0; scgd < 0x40; scgd++) {
314314
scl = ick / (20 + (scgd * 8) + round);
315-
if (scl <= t->bus_freq_hz)
315+
if (scl <= t.bus_freq_hz)
316316
goto scgd_find;
317317
}
318318
dev_err(dev, "it is impossible to calculate best SCL\n");
319319
return -EIO;
320320

321321
scgd_find:
322322
dev_dbg(dev, "clk %d/%d(%lu), round %u, CDF:0x%x, SCGD: 0x%x\n",
323-
scl, t->bus_freq_hz, rate, round, cdf, scgd);
323+
scl, t.bus_freq_hz, rate, round, cdf, scgd);
324324

325325
/* keep icccr value */
326326
priv->icccr = scgd << cdf_width | cdf;

0 commit comments

Comments
 (0)