Commit 6ef10df3 authored by Miquel Raynal's avatar Miquel Raynal

mtd: rawnand: Compare the actual timing values

Avoid relying just on the default timing mode to discriminate if the
data interface must be restored. This field should only be used
at initialization time by legacy chips statically defined. Do a
memcmp() instead.
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarBoris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/linux-mtd/20200529111322.7184-8-miquel.raynal@bootlin.com
parent a63674c7
...@@ -2512,7 +2512,8 @@ int nand_reset(struct nand_chip *chip, int chipnr) ...@@ -2512,7 +2512,8 @@ int nand_reset(struct nand_chip *chip, int chipnr)
* nand_setup_data_interface() uses ->set/get_features() which would * nand_setup_data_interface() uses ->set/get_features() which would
* fail anyway as the parameter page is not available yet. * fail anyway as the parameter page is not available yet.
*/ */
if (!chip->onfi_timing_mode_default) if (!memcmp(&chip->data_interface, &saved_data_intf,
sizeof(saved_data_intf)))
return 0; return 0;
chip->data_interface = saved_data_intf; chip->data_interface = saved_data_intf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment