mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Tanwar, Rahul" <rahul.tanwar@linux.intel.com>
Cc: u.kleine-koenig@pengutronix.de, linux-pwm@vger.kernel.org,
	lee.jones@linaro.org, thierry.reding@gmail.com,
	p.zabel@pengutronix.de, robh+dt@kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	songjun.Wu@intel.com, cheol.yong.kim@intel.com,
	qi-ming.wu@intel.com, rahul.tanwar.linux@gmail.com,
	rtanwar@maxlinear.com
Subject: Re: [PATCH v8 2/2] Add PWM fan controller driver for LGM SoC
Date: Fri, 21 Aug 2020 11:23:19 +0300	[thread overview]
Message-ID: <20200821082319.GI1891694@smile.fi.intel.com> (raw)
In-Reply-To: <ae472e72-8727-b62b-4fc7-f62aa41cafbc@linux.intel.com>

On Fri, Aug 21, 2020 at 02:07:49PM +0800, Tanwar, Rahul wrote:
> On 20/8/2020 6:52 pm, Andy Shevchenko wrote:
> > On Thu, Aug 20, 2020 at 12:50:46PM +0800, Rahul Tanwar wrote:

...

> >> +	ret = clk_prepare_enable(pc->clk);
> > Wrap it with devm_add_action_or_reset(). Same for reset_control_deassert().
> > You probably can even put them under one function.
> 
> I did some study and research for using devm_add_action_or_reset(). But
> still i have some doubts. Below steps is what i intend to do in order to
> switch to using this API. Please do review and let me know it is ok and
> i am not missing anything else. Thanks.
> 
> 1. Call reset_control_assert()
> 2. Call clk_prepare_enable()

> 3. Call pwmchip_add()

First of all, I haven't told anything about this.

> 4. Call devm_add_action_or_reset(dev, my_action, pc)
> 5. Remove explicit calls to unprepare/reset_control_assert from probe in
> failure cases.
> 6. static void my_action(void *pc)
>    {
>       pwmchip_remove(&pc->chip);
>       clk_disable_upprepare(pc->clk);
>       reset_control_assert(pc->rst);
>    }
> 7. Remove platform_driver.remove() entirely.

Nope, pwmchip_add() and pwmchip_remove() stay as is now.

Only wrap clock and reset resources.

> >> +	if (ret) {
> >> +		dev_err(dev, "failed to enable clock\n");
> >> +		reset_control_assert(pc->rst);
> >> +		return ret;
> >> +	}

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2020-08-21  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  4:50 [PATCH v8 0/2] pwm: intel: Add PWM driver for a new SoC Rahul Tanwar
2020-08-20  4:50 ` [PATCH v8 1/2] Add DT bindings YAML schema for PWM fan controller of LGM SoC Rahul Tanwar
2020-08-20  4:50 ` [PATCH v8 2/2] Add PWM fan controller driver for " Rahul Tanwar
2020-08-20 10:52   ` Andy Shevchenko
2020-08-21  6:07     ` Tanwar, Rahul
2020-08-21  8:23       ` Andy Shevchenko [this message]
2020-08-21  9:14     ` Tanwar, Rahul
2020-08-21 10:52       ` Andy Shevchenko

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=20200821082319.GI1891694@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=cheol.yong.kim@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=qi-ming.wu@intel.com \
    --cc=rahul.tanwar.linux@gmail.com \
    --cc=rahul.tanwar@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=rtanwar@maxlinear.com \
    --cc=songjun.Wu@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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®