Linux-PM Archive mirror
 help / color / mirror / Atom feed
From: Anand Moon <linux.amoon@gmail.com>
To: Chanwoo Choi <chanwoo@kernel.org>
Cc: Chanwoo Choi <cw00.choi@samsung.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	 Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	 Alim Akhtar <alim.akhtar@samsung.com>,
	linux-pm@vger.kernel.org,  linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] PM / devfreq: exynos: Use Use devm_clk_get_enabled() helpers
Date: Wed, 8 May 2024 22:53:54 +0530	[thread overview]
Message-ID: <CANAwSgQsqWSn4yvsgrEAyHTx2n7ccpeFqL-qUZG+3_=GgsF4rg@mail.gmail.com> (raw)
In-Reply-To: <CAGTfZH3oJQsc0XVrrA-F7NxSfKx8=mOYDM1Vvxt37+skvXZVaw@mail.gmail.com>

Hi Chanwoo

On Wed, 8 May 2024 at 21:16, Chanwoo Choi <chanwoo@kernel.org> wrote:
>
> On Wed, Apr 17, 2024 at 1:45 PM Anand Moon <linux.amoon@gmail.com> wrote:
> >
> > The devm_clk_get_enabled() helpers:
> >     - call devm_clk_get()
> >     - call clk_prepare_enable() and register what is needed in order to
> >      call clk_disable_unprepare() when needed, as a managed resource.
> >
> > This simplifies the code and avoids the calls to clk_disable_unprepare().
> >
> > While at it, use dev_err_probe consistently, and use its return value
> > to return the error code.
> >
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> > v3 - No change
> > v2 - No change
> > ---
> >  drivers/devfreq/exynos-bus.c | 21 ++++-----------------
> >  1 file changed, 4 insertions(+), 17 deletions(-)
> >
> > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> > index 245898f1a88e..153340b6685f 100644
> > --- a/drivers/devfreq/exynos-bus.c
> > +++ b/drivers/devfreq/exynos-bus.c
> > @@ -160,7 +160,6 @@ static void exynos_bus_exit(struct device *dev)
> >         platform_device_unregister(bus->icc_pdev);
> >
> >         dev_pm_opp_of_remove_table(dev);
> > -       clk_disable_unprepare(bus->clk);
> >         dev_pm_opp_put_regulators(bus->opp_token);
> >  }
> >
> > @@ -171,7 +170,6 @@ static void exynos_bus_passive_exit(struct device *dev)
> >         platform_device_unregister(bus->icc_pdev);
> >
> >         dev_pm_opp_of_remove_table(dev);
> > -       clk_disable_unprepare(bus->clk);
> >  }
> >
> >  static int exynos_bus_parent_parse_of(struct device_node *np,
> > @@ -247,23 +245,15 @@ static int exynos_bus_parse_of(struct device_node *np,
> >         int ret;
> >
> >         /* Get the clock to provide each bus with source clock */
> > -       bus->clk = devm_clk_get(dev, "bus");
> > -       if (IS_ERR(bus->clk)) {
> > -               dev_err(dev, "failed to get bus clock\n");
> > -               return PTR_ERR(bus->clk);
> > -       }
> > -
> > -       ret = clk_prepare_enable(bus->clk);
> > -       if (ret < 0) {
> > -               dev_err(dev, "failed to get enable clock\n");
> > -               return ret;
> > -       }
> > +       bus->clk = devm_clk_get_enabled(dev, "bus");
> > +       if (IS_ERR(bus->clk))
> > +               return dev_err_probe(dev, PTR_ERR(bus->clk), "failed to get bus clock\n");
>
> nitpick. I recommend that better to keep 80 char on one line as following
> for the readability.
>
>                return dev_err_probe(dev, PTR_ERR(bus->clk),
>                                           "failed to get bus clock\n");
>
Ok
>
I will update this in the next version.

Thanks
-Anand

      reply	other threads:[~2024-05-08 17:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  4:44 [PATCH v3 1/2] PM / devfreq: exynos: Use Use devm_clk_get_enabled() helpers Anand Moon
2024-04-17  4:44 ` [PATCH v3 2/2] PM / devfreq: exynos: Use DEFINE_SIMPLE_DEV_PM_OPS for PM functions Anand Moon
2024-05-08 15:42   ` Chanwoo Choi
2024-05-08 15:45 ` [PATCH v3 1/2] PM / devfreq: exynos: Use Use devm_clk_get_enabled() helpers Chanwoo Choi
2024-05-08 17:23   ` Anand Moon [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='CANAwSgQsqWSn4yvsgrEAyHTx2n7ccpeFqL-qUZG+3_=GgsF4rg@mail.gmail.com' \
    --to=linux.amoon@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=chanwoo@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).