spi: davinci: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Arvind Yadav 2017-06-05 17:36:28 +05:30 committed by Mark Brown
parent 2b747a5f04
commit 35fc3b9ff6
1 changed files with 3 additions and 1 deletions

View File

@ -964,7 +964,9 @@ static int davinci_spi_probe(struct platform_device *pdev)
ret = -ENODEV; ret = -ENODEV;
goto free_master; goto free_master;
} }
clk_prepare_enable(dspi->clk); ret = clk_prepare_enable(dspi->clk);
if (ret)
goto free_master;
master->dev.of_node = pdev->dev.of_node; master->dev.of_node = pdev->dev.of_node;
master->bus_num = pdev->id; master->bus_num = pdev->id;