From f571d9132e0657b4aae40a8ffe758224d1f41047 Mon Sep 17 00:00:00 2001 From: Clark Wang Date: Fri, 5 May 2023 14:41:59 +0800 Subject: [PATCH] spi: lpspi: run transfer speed_hz sanity check Avoid config.speed_hz is 0 when it is a divisor. Signed-off-by: Han Xu clk_per); + if (!config.speed_hz) { + dev_err(fsl_lpspi->dev, + "error: the transmission speed provided is 0!\n"); + return -EINVAL; + } + if (config.speed_hz > perclk_rate / 2) { dev_err(fsl_lpspi->dev, "per-clk should be at least two times of transfer speed");