Skip to content

Commit f131767

Browse files
zpershuaibroonie
authored andcommitted
spi: spi-zynq-qspi: Fix some wrong goto jumps & missing error code
In zynq_qspi_probe function, when enable the device clock is done, the return of all the functions should goto the clk_dis_all label. If num_cs is not right then this should return a negative error code but currently it returns success. Signed-off-by: zpershuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2ec6f20 commit f131767

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/spi/spi-zynq-qspi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,23 +678,24 @@ static int zynq_qspi_probe(struct platform_device *pdev)
678678
xqspi->irq = platform_get_irq(pdev, 0);
679679
if (xqspi->irq <= 0) {
680680
ret = -ENXIO;
681-
goto remove_master;
681+
goto clk_dis_all;
682682
}
683683
ret = devm_request_irq(&pdev->dev, xqspi->irq, zynq_qspi_irq,
684684
0, pdev->name, xqspi);
685685
if (ret != 0) {
686686
ret = -ENXIO;
687687
dev_err(&pdev->dev, "request_irq failed\n");
688-
goto remove_master;
688+
goto clk_dis_all;
689689
}
690690

691691
ret = of_property_read_u32(np, "num-cs",
692692
&num_cs);
693693
if (ret < 0) {
694694
ctlr->num_chipselect = 1;
695695
} else if (num_cs > ZYNQ_QSPI_MAX_NUM_CS) {
696+
ret = -EINVAL;
696697
dev_err(&pdev->dev, "only 2 chip selects are available\n");
697-
goto remove_master;
698+
goto clk_dis_all;
698699
} else {
699700
ctlr->num_chipselect = num_cs;
700701
}

0 commit comments

Comments
 (0)