Message ID | 20240730032040.3156393-3-liudingyuan@huawei.com |
---|---|
State | Accepted |
Commit | 5127c42c77de18651aa9e8e0a3ced190103b449c |
Headers | show |
Series | spi: hisi-kunpeng: Set verification for speed_hz and max_frequency | expand |
diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 6910b4d4c427..16054695bdb0 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -481,6 +481,9 @@ static int hisi_spi_probe(struct platform_device *pdev) return -EINVAL; } + if (host->max_speed_hz == 0) + return dev_err_probe(dev, -EINVAL, "spi-max-frequency can't be 0\n"); + ret = device_property_read_u16(dev, "num-cs", &host->num_chipselect); if (ret)