Commit 7c941281 authored by Arvind Yadav's avatar Arvind Yadav Committed by Boris Brezillon

mtd: nand: lpc32xx_slc: Handle return value of clk_prepare_enable.

clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent 24c9cd8f
...@@ -840,7 +840,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev) ...@@ -840,7 +840,9 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
res = -ENOENT; res = -ENOENT;
goto err_exit1; goto err_exit1;
} }
clk_prepare_enable(host->clk); res = clk_prepare_enable(host->clk);
if (res)
goto err_exit1;
/* Set NAND IO addresses and command/ready functions */ /* Set NAND IO addresses and command/ready functions */
chip->IO_ADDR_R = SLC_DATA(host->io_base); chip->IO_ADDR_R = SLC_DATA(host->io_base);
...@@ -972,9 +974,12 @@ static int lpc32xx_nand_remove(struct platform_device *pdev) ...@@ -972,9 +974,12 @@ static int lpc32xx_nand_remove(struct platform_device *pdev)
static int lpc32xx_nand_resume(struct platform_device *pdev) static int lpc32xx_nand_resume(struct platform_device *pdev)
{ {
struct lpc32xx_nand_host *host = platform_get_drvdata(pdev); struct lpc32xx_nand_host *host = platform_get_drvdata(pdev);
int ret;
/* Re-enable NAND clock */ /* Re-enable NAND clock */
clk_prepare_enable(host->clk); ret = clk_prepare_enable(host->clk);
if (ret)
return ret;
/* Fresh init of NAND controller */ /* Fresh init of NAND controller */
lpc32xx_nand_setup(host); lpc32xx_nand_setup(host);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment