]> Git Repo - linux.git/commitdiff
spi: dw: Fix error return code in dw_spi_bt1_probe()
authorZhang Changzhong <[email protected]>
Fri, 4 Dec 2020 08:42:37 +0000 (16:42 +0800)
committerMark Brown <[email protected]>
Mon, 7 Dec 2020 14:18:00 +0000 (14:18 +0000)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: abf00907538e ("spi: dw: Add Baikal-T1 SPI Controller glue driver")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhang Changzhong <[email protected]>
Acked-by: Serge Semin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
drivers/spi/spi-dw-bt1.c

index f382dfad7842131f68a9c0064c63075bc775cba5..c279b7891e3ac0bc50e968796129dac8cf9f81ea 100644 (file)
@@ -280,8 +280,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
        dws->bus_num = pdev->id;
        dws->reg_io_width = 4;
        dws->max_freq = clk_get_rate(dwsbt1->clk);
-       if (!dws->max_freq)
+       if (!dws->max_freq) {
+               ret = -EINVAL;
                goto err_disable_clk;
+       }
 
        init_func = device_get_match_data(&pdev->dev);
        ret = init_func(pdev, dwsbt1);
This page took 0.060188 seconds and 4 git commands to generate.