On Thu, Nov 9, 2017 at 5:09 PM, Baruch Siach <[email protected]> wrote: > Calling .set_speed with zero speed is definitely a bug. Return an error value > to handle that gracefully instead of crashing. > > Signed-off-by: Baruch Siach <[email protected]> > --- > drivers/spi/kirkwood_spi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/spi/kirkwood_spi.c b/drivers/spi/kirkwood_spi.c > index 0c6bd295cde9..9a27ac36822e 100644 > --- a/drivers/spi/kirkwood_spi.c > +++ b/drivers/spi/kirkwood_spi.c > @@ -257,6 +257,8 @@ static int mvebu_spi_set_speed(struct udevice *bus, uint > hz) > struct kwspi_registers *reg = plat->spireg; > u32 data; > > + if (hz == 0) > + return -EINVAL;
This isn't true, if hz 0 we should go with minimum divizer, usually tclk we can get it from dts as plat->frequency and check the same with speed to get the final speed. thanks! -- Jagan Teki Free Software Engineer | www.openedev.com U-Boot, Linux | Upstream Maintainer Hyderabad, India. _______________________________________________ U-Boot mailing list [email protected] https://lists.denx.de/listinfo/u-boot

