[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdeD6zDc--R4NPHsiqQerzfNGwUikLN+WHMiZZVsQ8QSA@mail.gmail.com>
Date: Fri, 5 Jun 2020 11:14:17 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Michael Walle <michael@...le.cc>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
devicetree <devicetree@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-hwmon@...r.kernel.org, linux-pwm@...r.kernel.org,
linux-watchdog@...r.kernel.org,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Rob Herring <robh+dt@...nel.org>,
Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>,
Lee Jones <lee.jones@...aro.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Wim Van Sebroeck <wim@...ux-watchdog.org>,
Shawn Guo <shawnguo@...nel.org>, Li Yang <leoyang.li@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <maz@...nel.org>, Mark Brown <broonie@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v4 04/11] watchdog: add support for sl28cpld watchdog
On Fri, Jun 5, 2020 at 12:14 AM Michael Walle <michael@...le.cc> wrote:
>
> Add support for the watchdog of the sl28cpld board management
> controller. This is part of a multi-function device driver.
...
> +#include <linux/of_device.h>
Didn't find a user of this.
...
> +static bool nowayout = WATCHDOG_NOWAYOUT;
> +module_param(nowayout, bool, 0);
> +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
> + __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
> +
> +static int timeout;
> +module_param(timeout, int, 0);
> +MODULE_PARM_DESC(timeout, "Initial watchdog timeout in seconds");
Guenter ACKed this, but I'm wondering why we still need module parameters...
...
> + int ret;
> +
> + ret = regmap_read(wdt->regmap, wdt->offset + WDT_COUNT, &val);
> +
> + return (ret < 0) ? 0 : val;
Besides extra parentheses and questionable ' < 0' part, the following
would look better I think
ret = ...
if (ret)
return 0;
return val;
...
> + int ret;
> +
> + ret = regmap_write(wdt->regmap, wdt->offset + WDT_TIMEOUT, timeout);
> + if (!ret)
> + wdd->timeout = timeout;
> +
> + return ret;
Similar story here:
ret = ...
if (ret)
return ret;
wdd->... = ...
return 0;
...
> + ret = regmap_read(wdt->regmap, wdt->offset + WDT_CTRL, &status);
> + if (ret < 0)
What ' < 0' means? Do we have some positive return values?
Ditto for all your code.
> + return ret;
...
> + if (status & WDT_CTRL_EN) {
> + sl28cpld_wdt_start(wdd);
> + set_bit(WDOG_HW_RUNNING, &wdd->status);
Do you need atomic op here? Why?
> + }
...
> +static const struct of_device_id sl28cpld_wdt_of_match[] = {
> + { .compatible = "kontron,sl28cpld-wdt" },
> + {},
No comma.
> +};
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists