summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2017-02-17 23:08:17 +0100
committerCyrille Pitchen <cyrille.pitchen@atmel.com>2017-03-07 21:45:48 +0100
commit0a5165a83c624cddb3dfa227a9324acac9ec413c (patch)
tree74cede7cbc4ad88856bf7a227d6e2301ff1bfb11 /drivers
parentLinux 4.11-rc1 (diff)
downloadlinux-0a5165a83c624cddb3dfa227a9324acac9ec413c.tar.xz
linux-0a5165a83c624cddb3dfa227a9324acac9ec413c.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/spi-nor/hisi-sfc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/hisi-sfc.c b/drivers/mtd/spi-nor/hisi-sfc.c
index 20378b0d55e9..a286350627a6 100644
--- a/drivers/mtd/spi-nor/hisi-sfc.c
+++ b/drivers/mtd/spi-nor/hisi-sfc.c
@@ -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)