diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-11-28 10:11:28 +0200 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2021-01-12 10:21:41 +0530 |
commit | 705082d4b1a2040c9f1ff2a7d5c4f2fccafde4bc (patch) | |
tree | b53015f2ef2528e68b89b1ba0494aff30ab789ff /drivers/core/root.c | |
parent | 49b4c54bc969aae9a79e598266feec3d74275635 (diff) |
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: Ovidiu Panait <ovidiu.panait@windriver.com>
Diffstat (limited to 'drivers/core/root.c')
0 files changed, 0 insertions, 0 deletions