linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] sound:soc: fix return value check in imx_audmux_suspend
@ 2023-07-17 14:51 Yuanjun Gong
  2023-07-21  8:40 ` Shengjiu Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Yuanjun Gong @ 2023-07-17 14:51 UTC (permalink / raw)
  To: Yuanjun Gong, Shengjiu Wang, Xiubo Li, Fabio Estevam,
	linuxppc-dev

check the return value of clk_prepare_enable, and if
clk_prepare_enable got an unexpected return value,
imx_audmux_suspend should return the error value.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 sound/soc/fsl/imx-audmux.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index be003a117b39..962b6baf0a34 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -325,8 +325,11 @@ static void imx_audmux_remove(struct platform_device *pdev)
 static int imx_audmux_suspend(struct device *dev)
 {
 	int i;
+	ssize_t ret;
 
-	clk_prepare_enable(audmux_clk);
+	ret = clk_prepare_enable(audmux_clk);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < reg_max; i++)
 		regcache[i] = readl(audmux_base + i * 4);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/1] sound:soc: fix return value check in imx_audmux_suspend
  2023-07-17 14:51 [PATCH 1/1] sound:soc: fix return value check in imx_audmux_suspend Yuanjun Gong
@ 2023-07-21  8:40 ` Shengjiu Wang
  2023-07-22 12:36   ` [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable() Yuanjun Gong
  0 siblings, 1 reply; 6+ messages in thread
From: Shengjiu Wang @ 2023-07-21  8:40 UTC (permalink / raw)
  To: Yuanjun Gong; +Cc: linuxppc-dev, Fabio Estevam, Xiubo Li

[-- Attachment #1: Type: text/plain, Size: 1207 bytes --]

On Mon, Jul 17, 2023 at 10:51 PM Yuanjun Gong <ruc_gongyuanjun@163.com>
wrote:

> check the return value of clk_prepare_enable, and if
> clk_prepare_enable got an unexpected return value,
> imx_audmux_suspend should return the error value.
>
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  sound/soc/fsl/imx-audmux.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
> index be003a117b39..962b6baf0a34 100644
> --- a/sound/soc/fsl/imx-audmux.c
> +++ b/sound/soc/fsl/imx-audmux.c
> @@ -325,8 +325,11 @@ static void imx_audmux_remove(struct platform_device
> *pdev)
>  static int imx_audmux_suspend(struct device *dev)
>  {
>         int i;
> +       ssize_t ret;
>
> -       clk_prepare_enable(audmux_clk);
> +       ret = clk_prepare_enable(audmux_clk);
> +       if (ret)
> +               return ret;
>
> Please combine the two related patches together as one patch.

commit subject can use ASoC: imx-audmux: xxxxx

best regards
wang shengjiu

>         for (i = 0; i < reg_max; i++)
>                 regcache[i] = readl(audmux_base + i * 4);
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 1881 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable()
  2023-07-21  8:40 ` Shengjiu Wang
@ 2023-07-22 12:36   ` Yuanjun Gong
  2023-07-22 12:40     ` Fabio Estevam
  2023-07-28  4:29     ` [PATCH v2 " Shengjiu Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Yuanjun Gong @ 2023-07-22 12:36 UTC (permalink / raw)
  To: shengjiu.wang; +Cc: linuxppc-dev, ruc_gongyuanjun, festevam, Xiubo.Lee

check the return value of clk_prepare_enable(), and if
clk_prepare_enable() gets an unexpected return value,
imx_audmux_suspend() and imx_audmux_resume() should return
the error value.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 sound/soc/fsl/imx-audmux.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index be003a117b39..9791e56158ef 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -325,8 +325,11 @@ static void imx_audmux_remove(struct platform_device *pdev)
 static int imx_audmux_suspend(struct device *dev)
 {
 	int i;
+	ssize_t ret;
 
-	clk_prepare_enable(audmux_clk);
+	ret = clk_prepare_enable(audmux_clk);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < reg_max; i++)
 		regcache[i] = readl(audmux_base + i * 4);
@@ -339,8 +342,11 @@ static int imx_audmux_suspend(struct device *dev)
 static int imx_audmux_resume(struct device *dev)
 {
 	int i;
+	ssize_t ret;
 
-	clk_prepare_enable(audmux_clk);
+	ret = clk_prepare_enable(audmux_clk);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < reg_max; i++)
 		writel(regcache[i], audmux_base + i * 4);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable()
  2023-07-22 12:36   ` [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable() Yuanjun Gong
@ 2023-07-22 12:40     ` Fabio Estevam
  2023-07-25  1:47       ` [PATCH v3 " Yuanjun Gong
  2023-07-28  4:29     ` [PATCH v2 " Shengjiu Wang
  1 sibling, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2023-07-22 12:40 UTC (permalink / raw)
  To: Yuanjun Gong; +Cc: linuxppc-dev, shengjiu.wang, Xiubo.Lee

On Sat, Jul 22, 2023 at 9:38 AM Yuanjun Gong <ruc_gongyuanjun@163.com> wrote:
>
> check the return value of clk_prepare_enable(), and if
> clk_prepare_enable() gets an unexpected return value,
> imx_audmux_suspend() and imx_audmux_resume() should return
> the error value.
>
> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  sound/soc/fsl/imx-audmux.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
> index be003a117b39..9791e56158ef 100644
> --- a/sound/soc/fsl/imx-audmux.c
> +++ b/sound/soc/fsl/imx-audmux.c
> @@ -325,8 +325,11 @@ static void imx_audmux_remove(struct platform_device *pdev)
>  static int imx_audmux_suspend(struct device *dev)
>  {
>         int i;
> +       ssize_t ret;

Why not simply "int ret" instead?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable()
  2023-07-22 12:40     ` Fabio Estevam
@ 2023-07-25  1:47       ` Yuanjun Gong
  0 siblings, 0 replies; 6+ messages in thread
From: Yuanjun Gong @ 2023-07-25  1:47 UTC (permalink / raw)
  To: festevam; +Cc: shengjiu.wang, ruc_gongyuanjun, linuxppc-dev, Xiubo.Lee

check the return value of clk_prepare_enable(), and if
clk_prepare_enable() gets an unexpected return value,
imx_audmux_suspend() and imx_audmux_resume() should return
the error value.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 sound/soc/fsl/imx-audmux.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index be003a117b39..096705ec2add 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -324,9 +324,11 @@ static void imx_audmux_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int imx_audmux_suspend(struct device *dev)
 {
-	int i;
+	int i, ret;
 
-	clk_prepare_enable(audmux_clk);
+	ret = clk_prepare_enable(audmux_clk);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < reg_max; i++)
 		regcache[i] = readl(audmux_base + i * 4);
@@ -338,9 +340,11 @@ static int imx_audmux_suspend(struct device *dev)
 
 static int imx_audmux_resume(struct device *dev)
 {
-	int i;
+	int i, ret;
 
-	clk_prepare_enable(audmux_clk);
+	ret = clk_prepare_enable(audmux_clk);
+	if (ret)
+		return ret;
 
 	for (i = 0; i < reg_max; i++)
 		writel(regcache[i], audmux_base + i * 4);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable()
  2023-07-22 12:36   ` [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable() Yuanjun Gong
  2023-07-22 12:40     ` Fabio Estevam
@ 2023-07-28  4:29     ` Shengjiu Wang
  1 sibling, 0 replies; 6+ messages in thread
From: Shengjiu Wang @ 2023-07-28  4:29 UTC (permalink / raw)
  To: Yuanjun Gong; +Cc: linuxppc-dev, festevam, Xiubo.Lee

[-- Attachment #1: Type: text/plain, Size: 1650 bytes --]

On Sat, Jul 22, 2023 at 8:38 PM Yuanjun Gong <ruc_gongyuanjun@163.com>
wrote:

> check the return value of clk_prepare_enable(), and if
> clk_prepare_enable() gets an unexpected return value,
> imx_audmux_suspend() and imx_audmux_resume() should return
> the error value.
>
>
please use the ./scripts/get_maintainer.pl to get the maillist
and resend the patch.

best regards
wang shengjiu


> Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
> ---
>  sound/soc/fsl/imx-audmux.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
> index be003a117b39..9791e56158ef 100644
> --- a/sound/soc/fsl/imx-audmux.c
> +++ b/sound/soc/fsl/imx-audmux.c
> @@ -325,8 +325,11 @@ static void imx_audmux_remove(struct platform_device
> *pdev)
>  static int imx_audmux_suspend(struct device *dev)
>  {
>         int i;
> +       ssize_t ret;
>
> -       clk_prepare_enable(audmux_clk);
> +       ret = clk_prepare_enable(audmux_clk);
> +       if (ret)
> +               return ret;
>
>         for (i = 0; i < reg_max; i++)
>                 regcache[i] = readl(audmux_base + i * 4);
> @@ -339,8 +342,11 @@ static int imx_audmux_suspend(struct device *dev)
>  static int imx_audmux_resume(struct device *dev)
>  {
>         int i;
> +       ssize_t ret;
>
> -       clk_prepare_enable(audmux_clk);
> +       ret = clk_prepare_enable(audmux_clk);
> +       if (ret)
> +               return ret;
>
>         for (i = 0; i < reg_max; i++)
>                 writel(regcache[i], audmux_base + i * 4);
> --
> 2.17.1
>
>

[-- Attachment #2: Type: text/html, Size: 2448 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-28 13:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17 14:51 [PATCH 1/1] sound:soc: fix return value check in imx_audmux_suspend Yuanjun Gong
2023-07-21  8:40 ` Shengjiu Wang
2023-07-22 12:36   ` [PATCH v2 1/1] ASoC: imx-audmux: fix return value checks of clk_prepare_enable() Yuanjun Gong
2023-07-22 12:40     ` Fabio Estevam
2023-07-25  1:47       ` [PATCH v3 " Yuanjun Gong
2023-07-28  4:29     ` [PATCH v2 " Shengjiu Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).