diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-05 21:52:21 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-06 07:52:58 -0500 |
commit | 91cfe7e73b484703baf353d3915823210a417d77 (patch) | |
tree | 24d35edf7e4e97e3e6b5dc6257fff6e99d013892 /drivers/spi/spi-davinci.c | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) |
spi: davinci: Remove unneeded NULL checking for dspi and dspi->bitbang.master
spi_master_get_devdata() never returns NULL when spi_alloc_master() success,
so remove NULL test for dspi.
We have ensured master is not NULL before assigning it to dspi->bitbang.master.
So also remove NULL test for dspi->bitbang.master.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-davinci.c')
-rw-r--r-- | drivers/spi/spi-davinci.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 5e7389faa2a0..04d69b650328 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c | |||
@@ -864,10 +864,6 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
864 | platform_set_drvdata(pdev, master); | 864 | platform_set_drvdata(pdev, master); |
865 | 865 | ||
866 | dspi = spi_master_get_devdata(master); | 866 | dspi = spi_master_get_devdata(master); |
867 | if (dspi == NULL) { | ||
868 | ret = -ENOENT; | ||
869 | goto free_master; | ||
870 | } | ||
871 | 867 | ||
872 | if (dev_get_platdata(&pdev->dev)) { | 868 | if (dev_get_platdata(&pdev->dev)) { |
873 | pdata = dev_get_platdata(&pdev->dev); | 869 | pdata = dev_get_platdata(&pdev->dev); |
@@ -908,10 +904,6 @@ static int davinci_spi_probe(struct platform_device *pdev) | |||
908 | goto free_master; | 904 | goto free_master; |
909 | 905 | ||
910 | dspi->bitbang.master = master; | 906 | dspi->bitbang.master = master; |
911 | if (dspi->bitbang.master == NULL) { | ||
912 | ret = -ENODEV; | ||
913 | goto free_master; | ||
914 | } | ||
915 | 907 | ||
916 | dspi->clk = devm_clk_get(&pdev->dev, NULL); | 908 | dspi->clk = devm_clk_get(&pdev->dev, NULL); |
917 | if (IS_ERR(dspi->clk)) { | 909 | if (IS_ERR(dspi->clk)) { |