1
0
Fork 0

mtd: spi-nor: hisi: do not ignore clk_prepare_enable() failure

hisi_spi_nor_probe() ignores clk_prepare_enable() error code.
The patch fixes that.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Cyrille Pitchen <cyrille.pitchen@atmel.com>
hifive-unleashed-5.1
Alexey Khoroshilov 2017-02-18 01:08:17 +03:00 committed by Cyrille Pitchen
parent c1ae3cfa0e
commit 0a5165a83c
1 changed files with 4 additions and 1 deletions

View File

@ -448,8 +448,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
if (!host->buffer)
return -ENOMEM;
ret = clk_prepare_enable(host->clk);
if (ret)
return ret;
mutex_init(&host->lock);
clk_prepare_enable(host->clk);
hisi_spi_nor_init(host);
ret = hisi_spi_nor_register_all(host);
if (ret)