mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, Len Brown <len.brown@intel.com>,
	Pavel Machek <pavel@ucw.cz>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] v2 pm: clk: fix a missing check of clk_prepare
Date: Wed, 16 Jan 2019 13:00:54 +0100	[thread overview]
Message-ID: <1699761.45DYuq6sLL@aspire.rjw.lan> (raw)
In-Reply-To: <20190105195845.5453-1-pakki001@umn.edu>

On Saturday, January 5, 2019 8:58:45 PM CET Aditya Pakki wrote:
> clk_prepare() could fail, so let's check its status, and if it fails,
> issue an error message and change the clock_entry_status to
> PCE_STATUS_ERROR
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
>  drivers/base/power/clock_ops.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index 5a42ae4078c2..732764becafe 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -65,10 +65,15 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
>  	if (IS_ERR(ce->clk)) {
>  		ce->status = PCE_STATUS_ERROR;
>  	} else {
> -		clk_prepare(ce->clk);
> -		ce->status = PCE_STATUS_ACQUIRED;
> -		dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",
> -			ce->clk, ce->con_id);
> +		if (clk_prepare(ce->clk)) {
> +			ce->status = PCE_STATUS_ERROR;
> +			dev_err(dev, "clk_prepare failed\n");
> +		} else {
> +			ce->status = PCE_STATUS_ACQUIRED;
> +			dev_dbg(dev,
> +				"Clock %pC con_id %s managed by runtime PM.\n",
> +				ce->clk, ce->con_id);
> +		}
>  	}
>  }
>  
> 

Applied (with some minor modifications), thanks!



      reply	other threads:[~2019-01-16 12:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-05 19:58 Aditya Pakki
2019-01-16 12:00 ` Rafael J. Wysocki [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=1699761.45DYuq6sLL@aspire.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kjlu@umn.edu \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=pavel@ucw.cz \
    /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®