From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932823AbbA3OsK (ORCPT ); Fri, 30 Jan 2015 09:48:10 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:33640 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932705AbbA3OsI (ORCPT ); Fri, 30 Jan 2015 09:48:08 -0500 Message-ID: <54CB9994.1020503@roeck-us.net> Date: Fri, 30 Jan 2015 06:47:48 -0800 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Vivien Didelot , linux-watchdog@vger.kernel.org CC: Wim Van Sebroeck , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com Subject: Re: [PATCH 2/4] watchdog: max63xx: cleanup References: <1422551745-29101-1-git-send-email-vivien.didelot@savoirfairelinux.com> <1422551745-29101-3-git-send-email-vivien.didelot@savoirfairelinux.com> In-Reply-To: <1422551745-29101-3-git-send-email-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020201.54CB99A7.01C5,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 2 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 > * > @@ -26,23 +24,33 @@ > #include > #include > > -#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