* [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable()
@ 2017-07-18 0:54 Fabio Estevam
2017-07-18 0:54 ` [PATCH v2 2/2] mtd: nand: vf610: Remove unneeded pinctrl_pm_select_default_state() Fabio Estevam
2017-08-04 8:30 ` [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Boris Brezillon
0 siblings, 2 replies; 3+ messages in thread
From: Fabio Estevam @ 2017-07-18 0:54 UTC (permalink / raw)
To: boris.brezillon; +Cc: stefan, linux-mtd, Fabio Estevam
From: Fabio Estevam <fabio.estevam@nxp.com>
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- None
drivers/mtd/nand/vf610_nfc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 744ab10..9e49672 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -814,12 +814,16 @@ static int vf610_nfc_suspend(struct device *dev)
static int vf610_nfc_resume(struct device *dev)
{
+ int err;
+
struct mtd_info *mtd = dev_get_drvdata(dev);
struct vf610_nfc *nfc = mtd_to_nfc(mtd);
pinctrl_pm_select_default_state(dev);
- clk_prepare_enable(nfc->clk);
+ err = clk_prepare_enable(nfc->clk);
+ if (err)
+ return err;
vf610_nfc_preinit_controller(nfc);
vf610_nfc_init_controller(nfc);
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] mtd: nand: vf610: Remove unneeded pinctrl_pm_select_default_state()
2017-07-18 0:54 [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Fabio Estevam
@ 2017-07-18 0:54 ` Fabio Estevam
2017-08-04 8:30 ` [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2017-07-18 0:54 UTC (permalink / raw)
To: boris.brezillon; +Cc: stefan, linux-mtd, Fabio Estevam
From: Fabio Estevam <fabio.estevam@nxp.com>
pinctrl_pm_select_default_state() is already the default pinctrl state and
since pinctrl_pm_select_sleep_state() is not used in this driver, there
is no need to explicitly call pinctrl_pm_select_default_state().
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v1:
- Newly introduced
drivers/mtd/nand/vf610_nfc.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
index 9e49672..b88a0c91 100644
--- a/drivers/mtd/nand/vf610_nfc.c
+++ b/drivers/mtd/nand/vf610_nfc.c
@@ -34,7 +34,6 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/of_device.h>
-#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -819,8 +818,6 @@ static int vf610_nfc_resume(struct device *dev)
struct mtd_info *mtd = dev_get_drvdata(dev);
struct vf610_nfc *nfc = mtd_to_nfc(mtd);
- pinctrl_pm_select_default_state(dev);
-
err = clk_prepare_enable(nfc->clk);
if (err)
return err;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable()
2017-07-18 0:54 [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Fabio Estevam
2017-07-18 0:54 ` [PATCH v2 2/2] mtd: nand: vf610: Remove unneeded pinctrl_pm_select_default_state() Fabio Estevam
@ 2017-08-04 8:30 ` Boris Brezillon
1 sibling, 0 replies; 3+ messages in thread
From: Boris Brezillon @ 2017-08-04 8:30 UTC (permalink / raw)
To: Fabio Estevam; +Cc: stefan, linux-mtd, Fabio Estevam
On Mon, 17 Jul 2017 21:54:07 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> clk_prepare_enable() may fail, so we should better check its return value
> and propagate it in the case of error.
>
Applied both.
Thanks,
Boris
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> Changes since v1:
> - None
>
> drivers/mtd/nand/vf610_nfc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c
> index 744ab10..9e49672 100644
> --- a/drivers/mtd/nand/vf610_nfc.c
> +++ b/drivers/mtd/nand/vf610_nfc.c
> @@ -814,12 +814,16 @@ static int vf610_nfc_suspend(struct device *dev)
>
> static int vf610_nfc_resume(struct device *dev)
> {
> + int err;
> +
> struct mtd_info *mtd = dev_get_drvdata(dev);
> struct vf610_nfc *nfc = mtd_to_nfc(mtd);
>
> pinctrl_pm_select_default_state(dev);
>
> - clk_prepare_enable(nfc->clk);
> + err = clk_prepare_enable(nfc->clk);
> + if (err)
> + return err;
>
> vf610_nfc_preinit_controller(nfc);
> vf610_nfc_init_controller(nfc);
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-04 8:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-18 0:54 [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Fabio Estevam
2017-07-18 0:54 ` [PATCH v2 2/2] mtd: nand: vf610: Remove unneeded pinctrl_pm_select_default_state() Fabio Estevam
2017-08-04 8:30 ` [PATCH v2 1/2] mtd: nand: vf610: Check the return value from clk_prepare_enable() Boris Brezillon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.