public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] Input: mt6779-keypad - use devm_clk_get_enabled()
Date: Wed, 28 Aug 2024 11:31:08 +0200	[thread overview]
Message-ID: <87r0a9q9ib.fsf@baylibre.com> (raw)
In-Reply-To: <Zs4UWGKt3hLjNmoP@google.com>

Hi Dmitry

Thank you for the patch.

On mar., août 27, 2024 at 11:00, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> Switch to using devm_clk_get_enable() helper instead of acquiring the
> clock with devm_clk_get(), enabling it, and defining and installing
> a custom devm action to call clk_disable().
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>

> ---
>  drivers/input/keyboard/mt6779-keypad.c | 18 +-----------------
>  1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/input/keyboard/mt6779-keypad.c b/drivers/input/keyboard/mt6779-keypad.c
> index 19f69d167fbd..c13880103429 100644
> --- a/drivers/input/keyboard/mt6779-keypad.c
> +++ b/drivers/input/keyboard/mt6779-keypad.c
> @@ -92,11 +92,6 @@ static irqreturn_t mt6779_keypad_irq_handler(int irq, void *dev_id)
>  	return IRQ_HANDLED;
>  }
>  
> -static void mt6779_keypad_clk_disable(void *data)
> -{
> -	clk_disable_unprepare(data);
> -}
> -
>  static void mt6779_keypad_calc_row_col_single(unsigned int key,
>  					      unsigned int *row,
>  					      unsigned int *col)
> @@ -213,21 +208,10 @@ static int mt6779_keypad_pdrv_probe(struct platform_device *pdev)
>  	regmap_update_bits(keypad->regmap, MTK_KPD_SEL, MTK_KPD_SEL_COL,
>  			   MTK_KPD_SEL_COLMASK(keypad->n_cols));
>  
> -	keypad->clk = devm_clk_get(&pdev->dev, "kpd");
> +	keypad->clk = devm_clk_get_enabled(&pdev->dev, "kpd");
>  	if (IS_ERR(keypad->clk))
>  		return PTR_ERR(keypad->clk);
>  
> -	error = clk_prepare_enable(keypad->clk);
> -	if (error) {
> -		dev_err(&pdev->dev, "cannot prepare/enable keypad clock\n");
> -		return error;
> -	}
> -
> -	error = devm_add_action_or_reset(&pdev->dev, mt6779_keypad_clk_disable,
> -					 keypad->clk);
> -	if (error)
> -		return error;
> -
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0)
>  		return irq;
> -- 
> 2.46.0.295.g3b9ea8a38a-goog
>
>
> -- 
> Dmitry

      reply	other threads:[~2024-08-28  9:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 18:00 [PATCH] Input: mt6779-keypad - use devm_clk_get_enabled() Dmitry Torokhov
2024-08-28  9:31 ` Mattijs Korpershoek [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=87r0a9q9ib.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    /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