Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91cfe7e7 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -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)) {