diff mbox

spi: davinci: Remove unneeded NULL checking for dspi and dspi->bitbang.master

Message ID 1391655141.12574.1.camel@phoenix (mailing list archive)
State Accepted
Commit 91cfe7e73b484703baf353d3915823210a417d77
Headers show

Commit Message

Axel Lin Feb. 6, 2014, 2:52 a.m. UTC
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>
---
 drivers/spi/spi-davinci.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Mark Brown Feb. 6, 2014, 12:53 p.m. UTC | #1
On Thu, Feb 06, 2014 at 10:52:21AM +0800, Axel Lin wrote:
> 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.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 5e7389f..04d69b6 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)
 	platform_set_drvdata(pdev, master);
 
 	dspi = spi_master_get_devdata(master);
-	if (dspi == NULL) {
-		ret = -ENOENT;
-		goto free_master;
-	}
 
 	if (dev_get_platdata(&pdev->dev)) {
 		pdata = dev_get_platdata(&pdev->dev);
@@ -908,10 +904,6 @@  static int davinci_spi_probe(struct platform_device *pdev)
 		goto free_master;
 
 	dspi->bitbang.master = master;
-	if (dspi->bitbang.master == NULL) {
-		ret = -ENODEV;
-		goto free_master;
-	}
 
 	dspi->clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(dspi->clk)) {