Skip to contentSkip to conversation

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

PATCH Applied Axel Lin 2 participants 2 messages Feb 6, 2014 SPI

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/spi/spi-davinci.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/spi/spi-davinci.c +0 -8
index 5e7389f..04d69b6 100644
@@ -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)) {
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#1 lore raw
Quoted 4 lines · Axel Lin

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.