On 01/29/2015 09:15 AM, Vivien Didelot wrote:
This patch cleans up the MAX63xx driver with the following:

   * better device description;
   * put module parameter just above their declaration for clarity;
   * remove global variables in favor of a driver data structure;
   * fix "quoted string split across lines" warning from checkpatch.pl;
   * constify timeouts;
   * factorize the SET write operations;
   * few typos and comments...

This will help introduce new features to the driver.

Signed-off-by: Vivien Didelot <vivien.dide...@savoirfairelinux.com>
---
  drivers/watchdog/Kconfig       |   7 +-
  drivers/watchdog/max63xx_wdt.c | 207 ++++++++++++++++++++---------------------
  2 files changed, 108 insertions(+), 106 deletions(-)

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 40ea835..fc10451 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -408,11 +408,14 @@ config TS72XX_WATCHDOG
          module will be called ts72xx_wdt.

  config MAX63XX_WATCHDOG
-       tristate "Max63xx watchdog"
+       tristate "Maxim MAX6369 Pin-Selectable Watchdog Timer and compatibles"
        depends on HAS_IOMEM
        select WATCHDOG_CORE
        help
-         Support for memory mapped max63{69,70,71,72,73,74} watchdog timer.
+         Support for MAX6369, MAX6370, MAX6371, MAX6372, MAX6373, and MAX6374.
+
+         To compile this driver as a module, choose M here:
+         the module will be called max63xx_wdt.

  config IMX2_WDT
        tristate "IMX2+ Watchdog"
diff --git a/drivers/watchdog/max63xx_wdt.c b/drivers/watchdog/max63xx_wdt.c
index 08da311..1d77669 100644
--- a/drivers/watchdog/max63xx_wdt.c
+++ b/drivers/watchdog/max63xx_wdt.c
@@ -1,7 +1,5 @@
  /*
- * drivers/char/watchdog/max63xx_wdt.c
- *
- * Driver for max63{69,70,71,72,73,74} watchdog timers
+ * Maxim MAX6369 Pin-Selectable Watchdog Timer and compatibles
   *
   * Copyright (C) 2009 Marc Zyngier <m...@misterjones.org>
   *
@@ -26,23 +24,33 @@
  #include <linux/io.h>
  #include <linux/slab.h>

-#define DEFAULT_HEARTBEAT 60
-#define MAX_HEARTBEAT     60
+#define DEFAULT_HEARTBEAT      60
+#define MAX_HEARTBEAT          60

-static unsigned int heartbeat = DEFAULT_HEARTBEAT;
-static bool nowayout  = WATCHDOG_NOWAYOUT;
+#define MAX63XX_DISABLED       3

-/*
- * Memory mapping: a single byte, 3 first lower bits to select bit 3
- * to ping the watchdog.
- */
-#define MAX6369_WDSET  (7 << 0)
-#define MAX6369_WDI    (1 << 3)

Not really sure I understand why you remove those constants.
that is personal preference, not cleanup. Someone else might
submit another cleanup later on and re-introduce them.

Guenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to