All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	linux-pwm@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 1/2] pwm: lpss: Release runtime-pm reference from the driver's remove callback
Date: Tue, 25 Sep 2018 12:09:23 +0300	[thread overview]
Message-ID: <20180925090923.GS15943@smile.fi.intel.com> (raw)
In-Reply-To: <20180925072536.17406-1-hdegoede@redhat.com>

On Tue, Sep 25, 2018 at 09:25:35AM +0200, Hans de Goede wrote:
> For each pwm output which gets enabled through pwm_lpss_apply(), we do a
> pm_runtime_get_sync().
> 
> This commit adds pm_runtime_put() calls to pwm_lpss_remove() to balance
> these when the driver gets removed with some of the outputs still enabled.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> 
> Fixes: f080be27d7d9 ("pwm: lpss: Add support for runtime PM")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> -New patch in v2 of this patch-set replacing "pwm: lpss: Add
>  pwm_lpss_get_put_runtime_pm helper function"
> ---
>  drivers/pwm/pwm-lpss.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/pwm/pwm-lpss.c b/drivers/pwm/pwm-lpss.c
> index e602835fd6de..723ca9de8325 100644
> --- a/drivers/pwm/pwm-lpss.c
> +++ b/drivers/pwm/pwm-lpss.c
> @@ -205,6 +205,12 @@ EXPORT_SYMBOL_GPL(pwm_lpss_probe);
>  
>  int pwm_lpss_remove(struct pwm_lpss_chip *lpwm)
>  {
> +	int i;
> +
> +	for (i = 0; i < lpwm->info->npwm; i++) {
> +		if (pwm_is_enabled(&lpwm->chip.pwms[i]))
> +			pm_runtime_put(lpwm->chip.dev);
> +	}
>  	return pwmchip_remove(&lpwm->chip);
>  }
>  EXPORT_SYMBOL_GPL(pwm_lpss_remove);
> -- 
> 2.19.0.rc1
> 

-- 
With Best Regards,
Andy Shevchenko

      parent reply	other threads:[~2018-09-25  9:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25  7:25 [PATCH v2 1/2] pwm: lpss: Release runtime-pm reference from the driver's remove callback Hans de Goede
2018-09-25  7:25 ` [PATCH v2 2/2] pwm: lpss: Add get_state callback Hans de Goede
2018-09-25  9:40   ` Andy Shevchenko
2018-09-25  9:09 ` Andy Shevchenko [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=20180925090923.GS15943@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@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 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.