[U-Boot] [PATCH 2/2 v2] watchdog: cadence: Remove driver specific "timeout-sec" handling
Stefan Roese
sr at denx.de
Tue Apr 9 13:41:29 UTC 2019
On 09.04.19 12:44, Michal Simek wrote:
> On 08. 04. 19 11:28, Stefan Roese wrote:
>> Now that we have a generic DT property "timeout-sec" handling, the
>> driver specific implementation can be dropped.
>>
>> This patch also changes the timeout restriction to the min and max
>> values (clipping). Before this patch, the value provided via
>> "timeout-sec" was used if the parameter was too high or low. Now
>> the driver specific min and max values are used instead.
>>
>> Signed-off-by: Stefan Roese <sr at denx.de>
>> Cc: Michal Simek <michal.simek at xilinx.com>
>> ---
>> v2:
>> - New patch
>>
>> drivers/watchdog/cdns_wdt.c | 13 ++++---------
>> 1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/watchdog/cdns_wdt.c b/drivers/watchdog/cdns_wdt.c
>> index fc85fbcec2..3ba3c8501c 100644
>> --- a/drivers/watchdog/cdns_wdt.c
>> +++ b/drivers/watchdog/cdns_wdt.c
>> @@ -23,7 +23,6 @@ struct cdns_regs {
>>
>> struct cdns_wdt_priv {
>> bool rst;
>> - u32 timeout;
>> struct cdns_regs *regs;
>> };
>>
>> @@ -142,10 +141,9 @@ static int cdns_wdt_start(struct udevice *dev, u64 timeout, ulong flags)
>> return -1;
>> }
>>
>> - if ((timeout < CDNS_WDT_MIN_TIMEOUT) ||
>> - (timeout > CDNS_WDT_MAX_TIMEOUT)) {
>> - timeout = priv->timeout;
>> - }
>
> here should be timeout /= 1000;
> because the whole timeout is handled in seconds not miliseconds.
Yes, thanks. Will update in the next version.
Thanks,
Stefan
More information about the U-Boot
mailing list