mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>, <m.szyprowski@samsung.com>,
	<mchehab@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: s5p-mfc: Handle error for clk_enable
Date: Tue, 8 Mar 2022 11:50:21 +0100	[thread overview]
Message-ID: <56c49d7f-33be-3d99-af65-edbf19a960c9@intel.com> (raw)
In-Reply-To: <20220308075538.1117983-1-jiasheng@iscas.ac.cn>

Hi,

On 08.03.2022 08:55, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.

It does not seem to be real issue. More below.


>
> Fixes: 1bce6fb3edf1 ("[media] s5p-mfc: Rework clock handling")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>   drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
> index 88b7d33c9197..392e6fab0a75 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_pm.c
> @@ -106,10 +106,12 @@ int s5p_mfc_power_on(void)
>   
>   int s5p_mfc_power_off(void)
>   {
> -	int i;
> +	int i, ret;
>   
>   	/* finish software clock gating */
> -	clk_enable(pm->clock_gate);
> +	ret = clk_enable(pm->clock_gate);
> +	if (ret)
> +		return ret;

Here clk_enable is just for balance enable counter for pm->clocks[0]. It 
does not matter if it succeeds, as it will be disabled in next lines.
For sure failure here should not stop power off sequence.

Regards
Andrzej

>   
>   	for (i = 0; i < pm->num_clocks; i++)
>   		clk_disable_unprepare(pm->clocks[i]);


      reply	other threads:[~2022-03-08 10:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  7:55 Jiasheng Jiang
2022-03-08 10:50 ` Andrzej Hajda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56c49d7f-33be-3d99-af65-edbf19a960c9@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®