2017-08-01 11:35:26

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/6] Handle clk_prepare_enable/clk_disable_unprepare.

clk_prepare_enable() can fail here and we must check its return value.
*_probe() can fail here and we must disable clock.

Arvind Yadav (6):
[PATCH 1/6] mtd: nand: denali: Handle return value of clk_prepare_enable.
[PATCH 2/6] mtd: oxnas_nand: Handle clk_prepare_enable/clk_disable_unprepare.
[PATCH 3/6] mtd: nand: lpc32xx_slc: Handle return value of clk_prepare_enable.
[PATCH 4/6] mtd: nand: vf610_nfc: Handle return value of clk_prepare_enable.
[PATCH 5/6] mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.
[PATCH 6/6] mtd: st_spi_fsm: Handle clk_prepare_enable/clk_disable_unprepare.

drivers/mtd/devices/st_spi_fsm.c | 20 ++++++++++++--------
drivers/mtd/nand/denali_dt.c | 4 +++-
drivers/mtd/nand/lpc32xx_mlc.c | 9 +++++++--
drivers/mtd/nand/lpc32xx_slc.c | 9 +++++++--
drivers/mtd/nand/oxnas_nand.c | 25 ++++++++++++++++++-------
drivers/mtd/nand/vf610_nfc.c | 5 ++++-
6 files changed, 51 insertions(+), 21 deletions(-)

--
1.9.1


2017-08-01 11:35:33

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/6] mtd: nand: denali: 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 <[email protected]>
---
drivers/mtd/nand/denali_dt.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 47f398e..56e2e17 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -118,7 +118,9 @@ static int denali_dt_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "no clk available\n");
return PTR_ERR(dt->clk);
}
- clk_prepare_enable(dt->clk);
+ ret = clk_prepare_enable(dt->clk);
+ if (ret)
+ return ret;

denali->clk_x_rate = clk_get_rate(dt->clk);

--
1.9.1

2017-08-04 07:31:26

by Boris Brezillon

[permalink] [raw]
Subject: Re: [PATCH 0/6] Handle clk_prepare_enable/clk_disable_unprepare.

On Tue, 1 Aug 2017 17:05:08 +0530
Arvind Yadav <[email protected]> wrote:

> clk_prepare_enable() can fail here and we must check its return value.
> *_probe() can fail here and we must disable clock.
>
> Arvind Yadav (6):
> [PATCH 1/6] mtd: nand: denali: Handle return value of clk_prepare_enable.
> [PATCH 2/6] mtd: oxnas_nand: Handle clk_prepare_enable/clk_disable_unprepare.
> [PATCH 3/6] mtd: nand: lpc32xx_slc: Handle return value of clk_prepare_enable.
> [PATCH 4/6] mtd: nand: vf610_nfc: Handle return value of clk_prepare_enable.
> [PATCH 5/6] mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.
> [PATCH 6/6] mtd: st_spi_fsm: Handle clk_prepare_enable/clk_disable_unprepare.

Applied everything except patch 4.

Thanks,

Boris

>
> drivers/mtd/devices/st_spi_fsm.c | 20 ++++++++++++--------
> drivers/mtd/nand/denali_dt.c | 4 +++-
> drivers/mtd/nand/lpc32xx_mlc.c | 9 +++++++--
> drivers/mtd/nand/lpc32xx_slc.c | 9 +++++++--
> drivers/mtd/nand/oxnas_nand.c | 25 ++++++++++++++++++-------
> drivers/mtd/nand/vf610_nfc.c | 5 ++++-
> 6 files changed, 51 insertions(+), 21 deletions(-)
>