Skip to content

Commit 43de979

Browse files
JeffyCNbroonie
authored andcommitted
spi: rockchip: Slightly rework return value handling
Slightly rework return value handling, no functional changes. Signed-off-by: Jeffy Chen <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5771a8c commit 43de979

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

drivers/spi/spi-rockchip.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static bool rockchip_spi_can_dma(struct spi_master *master,
666666

667667
static int rockchip_spi_probe(struct platform_device *pdev)
668668
{
669-
int ret = 0;
669+
int ret;
670670
struct rockchip_spi *rs;
671671
struct spi_master *master;
672672
struct resource *mem;
@@ -703,13 +703,13 @@ static int rockchip_spi_probe(struct platform_device *pdev)
703703
}
704704

705705
ret = clk_prepare_enable(rs->apb_pclk);
706-
if (ret) {
706+
if (ret < 0) {
707707
dev_err(&pdev->dev, "Failed to enable apb_pclk\n");
708708
goto err_put_master;
709709
}
710710

711711
ret = clk_prepare_enable(rs->spiclk);
712-
if (ret) {
712+
if (ret < 0) {
713713
dev_err(&pdev->dev, "Failed to enable spi_clk\n");
714714
goto err_disable_apbclk;
715715
}
@@ -786,7 +786,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
786786
}
787787

788788
ret = devm_spi_register_master(&pdev->dev, master);
789-
if (ret) {
789+
if (ret < 0) {
790790
dev_err(&pdev->dev, "Failed to register master\n");
791791
goto err_free_dma_rx;
792792
}
@@ -834,12 +834,12 @@ static int rockchip_spi_remove(struct platform_device *pdev)
834834
#ifdef CONFIG_PM_SLEEP
835835
static int rockchip_spi_suspend(struct device *dev)
836836
{
837-
int ret = 0;
837+
int ret;
838838
struct spi_master *master = dev_get_drvdata(dev);
839839
struct rockchip_spi *rs = spi_master_get_devdata(master);
840840

841841
ret = spi_master_suspend(rs->master);
842-
if (ret)
842+
if (ret < 0)
843843
return ret;
844844

845845
if (!pm_runtime_suspended(dev)) {
@@ -849,12 +849,12 @@ static int rockchip_spi_suspend(struct device *dev)
849849

850850
pinctrl_pm_select_sleep_state(dev);
851851

852-
return ret;
852+
return 0;
853853
}
854854

855855
static int rockchip_spi_resume(struct device *dev)
856856
{
857-
int ret = 0;
857+
int ret;
858858
struct spi_master *master = dev_get_drvdata(dev);
859859
struct rockchip_spi *rs = spi_master_get_devdata(master);
860860

@@ -878,7 +878,7 @@ static int rockchip_spi_resume(struct device *dev)
878878
clk_disable_unprepare(rs->apb_pclk);
879879
}
880880

881-
return ret;
881+
return 0;
882882
}
883883
#endif /* CONFIG_PM_SLEEP */
884884

@@ -901,14 +901,14 @@ static int rockchip_spi_runtime_resume(struct device *dev)
901901
struct rockchip_spi *rs = spi_master_get_devdata(master);
902902

903903
ret = clk_prepare_enable(rs->apb_pclk);
904-
if (ret)
904+
if (ret < 0)
905905
return ret;
906906

907907
ret = clk_prepare_enable(rs->spiclk);
908-
if (ret)
908+
if (ret < 0)
909909
clk_disable_unprepare(rs->apb_pclk);
910910

911-
return ret;
911+
return 0;
912912
}
913913
#endif /* CONFIG_PM */
914914

0 commit comments

Comments
 (0)