lkml.org 
[lkml]   [2019]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH V2 2/4] watchdog: Add i.MX7ULP watchdog support
Date
Hi, Guenter

> On Tue, Aug 20, 2019 at 08:31:55AM -0700, Guenter Roeck wrote:
> > On Mon, Aug 12, 2019 at 04:53:19PM +0800, Anson.Huang@nxp.com
> wrote:
> > > From: Anson Huang <Anson.Huang@nxp.com>
> > >
> > > The i.MX7ULP Watchdog Timer (WDOG) module is an independent timer
> > > that is available for system use.
> > > It provides a safety feature to ensure that software is executing as
> > > planned and that the CPU is not stuck in an infinite loop or
> > > executing unintended code. If the WDOG module is not serviced
> > > (refreshed) within a certain period, it resets the MCU.
> > >
> > > Add driver support for i.MX7ULP watchdog.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> >
> > Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> >
>
> Wait, I have to withdraw that.
>
> With clk_prepare_enable(), you'll also need to call clk_disable_unprepare()
> on remove. An easy way to do this and keep the code simple would be:
>
> static void imx7ulp_wdt_clk_disable_unprepare(void *data) {
> clk_disable_unprepare(data);
> }
>
> static int imx7ulp_wdt_probe(...)
> {
> ...
> ret = clk_prepare_enable(imx7ulp_wdt->clk);
> if (ret)
> return ret;
> ret = devm_add_action_or_reset(dev,
> imx7ulp_wdt_clk_disable_unprepare);
> if (ret)
> return ret;
> ...
>

Ah, yes, I added the error handle but missed the remove case, thanks for your kindly
suggestion, please help review V3.

Thanks,
Anson.
\
 
 \ /
  Last update: 2019-08-21 04:28    [W:0.042 / U:4.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site