Re: [PATCH v3 3/6] i2c: rcar: Consolidate timings calls in rcar_i2c_clock_calculate()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	struct i2c_timings i2c_t, *t = &i2c_t;
>  
>  	/* Fall back to previously used values if not supplied */
> -	t->bus_freq_hz = t->bus_freq_hz ?: 100000;
> -	t->scl_fall_ns = t->scl_fall_ns ?: 35;
> -	t->scl_rise_ns = t->scl_rise_ns ?: 200;
> -	t->scl_int_delay_ns = t->scl_int_delay_ns ?: 50;
> +	t->bus_freq_hz = I2C_MAX_STANDARD_MODE_FREQ;
> +	t->scl_fall_ns = 35;
> +	t->scl_rise_ns = 200;
> +	t->scl_int_delay_ns = 50;

Here, the initialization to 0 is missing, so some values are broken.

Why don't we just drop the pointer and init the array directly?

	struct i2c_timings t = {
		.bus_freq_hz = ...
		...
	}

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux