Skip to content
Commit 705082d4 authored by Ovidiu Panait's avatar Ovidiu Panait Committed by Lokesh Vutla
Browse files

spi: ti_qspi: Fix "spi-max-frequency" error path in ti_qspi_ofdata_to_platdata



struct ti_qspi_priv->max_hz is declared as unsigned int, so the following
error path check will always be false, even when "spi-max-frequency"
property is invalid/missing:
  priv->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", -1);
  if (priv->max_hz < 0) {
    ...
  }

Replace the fdtdec call with dev_read_u32_default() and use 0 as the
default value. Error out if max_hz is zero.

Signed-off-by: default avatarOvidiu Panait <ovidiu.panait@windriver.com>
parent 49b4c54b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment