public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: W_Armin@gmx.de
To: hdegoede@redhat.com
Cc: linux-hwmon@vger.kernel.org, linux@roeck-us.net, jdelvare@suse.com
Subject: [PATCH v2 3/4] hwmon: (sch56xx-common) Use helper function
Date: Sat,  8 May 2021 15:14:56 +0200	[thread overview]
Message-ID: <20210508131457.12780-4-W_Armin@gmx.de> (raw)
In-Reply-To: <20210508131457.12780-1-W_Armin@gmx.de>

From: Armin Wolf <W_Armin@gmx.de>

Use watchdog_set_nowayout() to process param
setting and change param type to bool.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/hwmon/sch56xx-common.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
index 0b3250fc57b8..180801f80118 100644
--- a/drivers/hwmon/sch56xx-common.c
+++ b/drivers/hwmon/sch56xx-common.c
@@ -20,8 +20,8 @@
 #include "sch56xx-common.h"

 /* Insmod parameters */
-static int nowayout = WATCHDOG_NOWAYOUT;
-module_param(nowayout, int, 0);
+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) ")");

@@ -420,8 +420,7 @@ void sch56xx_watchdog_register(struct device *parent, u16 addr, u32 revision,
 	data->wddev.timeout = 60;
 	data->wddev.min_timeout = 1;
 	data->wddev.max_timeout = 255 * 60;
-	if (nowayout)
-		set_bit(WDOG_NO_WAY_OUT, &data->wddev.status);
+	watchdog_set_nowayout(&data->wddev, nowayout);
 	if (output_enable & SCH56XX_WDOG_OUTPUT_ENABLE)
 		set_bit(WDOG_ACTIVE, &data->wddev.status);

--
2.20.1


  parent reply	other threads:[~2021-05-08 13:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08 13:14 [PATCH v2 0/4] hwmon: (sch56xx) Use devres for watchdog and platform_device_register_simple() W_Armin
2021-05-08 13:14 ` [PATCH v2 1/4] hwmon: (sch56xx) Use devres functions for watchdog W_Armin
2021-05-10 15:34   ` Guenter Roeck
2021-05-08 13:14 ` [PATCH v2 2/4] hwmon: (sch56xx-common) Use strscpy W_Armin
2021-05-10 15:35   ` Guenter Roeck
2021-05-08 13:14 ` W_Armin [this message]
2021-05-10 15:36   ` [PATCH v2 3/4] hwmon: (sch56xx-common) Use helper function Guenter Roeck
2021-05-08 13:14 ` [PATCH v2 4/4] hwmon: (sch56xx-common) Simplify sch56xx_device_add W_Armin
2021-05-10 15:36   ` Guenter Roeck
2021-05-08 13:38 ` [PATCH v2 0/4] hwmon: (sch56xx) Use devres for watchdog and platform_device_register_simple() Hans de Goede

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=20210508131457.12780-4-W_Armin@gmx.de \
    --to=w_armin@gmx.de \
    --cc=hdegoede@redhat.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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