lkml.org 
[lkml]   [2021]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] Input: omap4-keypad - use PM runtime autosuspend
Hi Tony,

On Sun, Jan 10, 2021 at 09:05:28PM +0200, Tony Lindgren wrote:
> @@ -350,15 +379,12 @@ static int omap4_keypad_probe(struct platform_device *pdev)
>
> error = omap4_keypad_check_revision(&pdev->dev,
> keypad_data);
> - if (!error) {
> - /* Ensure device does not raise interrupts */
> - omap4_keypad_stop(keypad_data);
> - }
> -
> - pm_runtime_put_sync(&pdev->dev);

Why are we moving this down? The idea was to make sure the power usage
counters are correct even if we exit probe early.

Can we call pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend()
here?

> if (error)
> return error;
>
> + /* Ensure device does not raise interrupts */
> + omap4_keypad_stop(keypad_data);
> +
> /* input device allocation */
> keypad_data->input = input_dev = devm_input_allocate_device(dev);
> if (!input_dev)
> @@ -419,7 +445,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
> if (error)
> dev_warn(dev, "failed to set up wakeup irq: %d\n", error);
>
> - platform_set_drvdata(pdev, keypad_data);
> + pm_runtime_mark_last_busy(&pdev->dev);
> + pm_runtime_put_autosuspend(&pdev->dev);
>
> return 0;
> }
> --
> 2.30.0

Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2021-01-11 06:06    [W:0.075 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site