[PATCH v2 4/8] mtd: spi-nor: spansion: switch set_octal_dtr method to use vreg_offset

Tudor Ambarus tudor.ambarus at linaro.org
Fri Jul 21 22:25:22 PDT 2023



On 21.07.2023 19:49, Tudor Ambarus wrote:
> 
>>>  static int cypress_nor_set_octal_dtr(struct spi_nor *nor, bool enable)
>>>  {
>> const struct spi_nor_flash_parameter *params = nor->params;
>>
>>> +	if (!nor->params->vreg_offset) {
>>
>> wouldn't hurt to check for params->n_dice as well, even though one
>> implies the other. In the next patch you have a loop with n-dice being
>> the max number of elements. If n-dice becomes zero sometime, the loop is
>> skipped. Thus:
>>
>> 	if (params->n_dice && !nor->params->vreg_offset)
>>
> 	if (!params->n_dice || !params->vreg_offset)

and this sanity check should be moved to s28hx_t_late_init(), this way
we do it once, as it's needed when setting
cypress_nor_sr_ready_and_clear() too.



More information about the linux-mtd mailing list