Tudor Ambarus 65a01be4f5 mtd: rawnand: Rework of_get_nand_bus_width()
of_get_nand_bus_width() had a wrong behavior because:
1/ it ignored the -ENODATA and -EOVERFLOW return values of
   of_property_read_u32(). "nand-bus-width" without value was tolerated
   while it shouldn't have been according to the devicetree bindings.
2/ returned -EIO when the nand-bus-width was neither 8 nor 16, when it
   should have returned -EINVAL instead.
3/ returned the 8 or 16 bus-width integer, but it was never used it its
   caller. A simply return 0 on success is enough.
Rework of_get_nand_bus_width() and address all the above. The execution
is now stopped in case of errors.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220106131610.225661-2-tudor.ambarus@microchip.com
2022-01-23 16:37:18 +01:00
..
2022-01-11 11:35:28 -08:00
2022-01-11 11:35:28 -08:00
2021-07-05 11:21:51 -07:00
2022-01-12 10:26:52 -08:00