From: Lokesh Vutla Date: Wed, 23 Dec 2020 13:45:25 +0530 Subject: [PATCH] spi: ti_qspi: Fix "spi-max-frequency" error path in ti_qspi_ofdata_to_platdata In-Reply-To: <20201128081128.9669-1-ovidiu.panait@windriver.com> References: <20201128081128.9669-1-ovidiu.panait@windriver.com> Message-ID: <23c7dcac-ab4a-2ca4-448a-09efb6596938@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 28/11/20 1:41 pm, Ovidiu Panait wrote: > 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 Applied to u-boot-ti/for-next Thanks and regards, Lokesh