Skip to content

Commit

Permalink
spi: davinci: Remove unneeded NULL checking for dspi and dspi->bitban…
Browse files Browse the repository at this point in the history
…g.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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Feb 6, 2014
1 parent 38dbfb5 commit 91cfe7e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/spi/spi-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 91cfe7e

Please sign in to comment.