> -----Original Message----- > From: Guenter Roeck [mailto:groeck7@xxxxxxxxx] On Behalf Of Guenter Roeck > Sent: Sunday, January 2, 2022 11:00 PM > To: xt.hu[胡先韬] <xt.hu@xxxxxxxxxxx> > Cc: wim@xxxxxxxxxxxxxxxxxx; p.zabel@xxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; > linux-watchdog@xxxxxxxxxxxxxxx; robh+dt@xxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx; Wells Lu 呂芳騰 > <wells.lu@xxxxxxxxxxx>; qinjian[覃健] <qinjian@xxxxxxxxxxx> > Subject: Re: [PATCH v4 2/2] watchdog: Add watchdog driver for Sunplus SP7021 > > On Wed, Dec 29, 2021 at 01:43:08PM +0800, Xiantao Hu wrote: > > Sunplus SP7021 requires watchdog timer support. > > Add watchdog driver to enable this. > > > > Signed-off-by: Xiantao Hu <xt.hu@xxxxxxxxxxx> > > --- > > Changes in v4 > > - Drop the unused varible struct resource *wdt_res. > > - Drop the operations related to address 0x9c000274. > > Put it in bootloader before entry kernel boot in v3. > > > >... > > +{ > > + wdev->timeout = timeout; > > + sp_wdt_ping(wdev); > > This is exactly what the calling code does if there is no set_timeout > function, so you can just drop this function, > OK. I will drop it. > > ... > > + > > + err = clk_prepare_enable(priv->clk); > > + if (err) { > > + dev_err(dev, "Clock can't be enabled correctly\n"); > > + return err; > > + } > > + > > + /* The timer and watchdog shared the STC reset */ > > + priv->rstc = devm_reset_control_get_shared(dev, NULL); > > + if (!IS_ERR(priv->rstc)) > > + reset_control_deassert(priv->rstc); > > + > > + err = devm_add_action_or_reset(dev, sp_reset_control_assert, > > + priv->rstc); > > + if (err) > > + return err; > > + > > devm_add_action_or_reset() above should only be called if > devm_reset_control_get_shared succeeds. > OK. I will modify it. > > + err = devm_add_action_or_reset(dev, sp_clk_disable_unprepare, > > + priv->clk); > > This should be called immediately after clk_prepare_enable(). > OK. I will modify it. > > + if (err) > > + return err; > > ...