From: Lyude Paul <lyude@redhat.com>
To: Guenter Roeck <linux@roeck-us.net>, Wim Van Sebroeck <wim@iguana.be>
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org,
"Zoltán Böszörményi" <zboszor@pr.hu>
Subject: Re: [08/12] watchdog: sp5100_tco: Clean up function and variable names
Date: Tue, 16 Jan 2018 15:05:56 -0500 [thread overview]
Message-ID: <1516133156.18904.17.camel@redhat.com> (raw)
In-Reply-To: <1514149457-20273-9-git-send-email-linux@roeck-us.net>
Reviewed-by: Lyude Paul <lyude@redhat.com>
On Sun, 2017-12-24 at 13:04 -0800, Guenter Roeck wrote:
> Use more common function and variable names.
>
> Use pdev instead of dev for platform device.
> Use sp5100_tco_probe() instead of sp5100_tco_init() for the probe function.
> Drop sp5100_tco_cleanup(); just move the code into sp5100_tco_remove().
> Use sp5100_tco_init() instead of sp5100_tco_init_module() for the module
> initialization function.
> Use sp5100_tco_exit() instead of sp5100_tco_cleanup_module() for the module
> exit function.
> Use consistent defines for accessing the watchdog control register.
>
> Cc: Zoltán Böszörményi <zboszor@pr.hu>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/watchdog/sp5100_tco.c | 25 ++++++++++---------------
> drivers/watchdog/sp5100_tco.h | 5 ++---
> 2 files changed, 12 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c
> index ff240e5be833..1123fad38fdf 100644
> --- a/drivers/watchdog/sp5100_tco.c
> +++ b/drivers/watchdog/sp5100_tco.c
> @@ -421,8 +421,8 @@ static int sp5100_tco_setupdevice(struct device *dev)
> * Save WatchDogFired status, because WatchDogFired flag is
> * cleared here.
> */
> - tco_wdt_fired = val & SP5100_PM_WATCHDOG_FIRED;
> - val &= ~SP5100_PM_WATCHDOG_ACTION_RESET;
> + tco_wdt_fired = val & SP5100_WDT_FIRED;
> + val &= ~SP5100_WDT_ACTION_RESET;
> writel(val, SP5100_WDT_CONTROL(tcobase));
>
> /* Set a reasonable heartbeat before we stop the timer */
> @@ -445,7 +445,7 @@ static int sp5100_tco_setupdevice(struct device *dev)
> return ret;
> }
>
> -static int sp5100_tco_init(struct platform_device *pdev)
> +static int sp5100_tco_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> int ret;
> @@ -492,7 +492,7 @@ static int sp5100_tco_init(struct platform_device *pdev)
> return ret;
> }
>
> -static void sp5100_tco_cleanup(void)
> +static int sp5100_tco_remove(struct platform_device *pdev)
> {
> /* Stop the timer before we leave */
> if (!nowayout)
> @@ -502,22 +502,17 @@ static void sp5100_tco_cleanup(void)
> misc_deregister(&sp5100_tco_miscdev);
> iounmap(tcobase);
> release_mem_region(tcobase_phys, SP5100_WDT_MEM_MAP_SIZE);
> -}
>
> -static int sp5100_tco_remove(struct platform_device *dev)
> -{
> - if (tcobase)
> - sp5100_tco_cleanup();
> return 0;
> }
>
> -static void sp5100_tco_shutdown(struct platform_device *dev)
> +static void sp5100_tco_shutdown(struct platform_device *pdev)
> {
> tco_timer_stop();
> }
>
> static struct platform_driver sp5100_tco_driver = {
> - .probe = sp5100_tco_init,
> + .probe = sp5100_tco_probe,
> .remove = sp5100_tco_remove,
> .shutdown = sp5100_tco_shutdown,
> .driver = {
> @@ -544,7 +539,7 @@ static const struct pci_device_id sp5100_tco_pci_tbl[] =
> {
> };
> MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl);
>
> -static int __init sp5100_tco_init_module(void)
> +static int __init sp5100_tco_init(void)
> {
> struct pci_dev *dev = NULL;
> int err;
> @@ -580,14 +575,14 @@ static int __init sp5100_tco_init_module(void)
> return err;
> }
>
> -static void __exit sp5100_tco_cleanup_module(void)
> +static void __exit sp5100_tco_exit(void)
> {
> platform_device_unregister(sp5100_tco_platform_device);
> platform_driver_unregister(&sp5100_tco_driver);
> }
>
> -module_init(sp5100_tco_init_module);
> -module_exit(sp5100_tco_cleanup_module);
> +module_init(sp5100_tco_init);
> +module_exit(sp5100_tco_exit);
>
> MODULE_AUTHOR("Priyanka Gupta");
> MODULE_DESCRIPTION("TCO timer driver for SP5100/SB800 chipset");
> diff --git a/drivers/watchdog/sp5100_tco.h b/drivers/watchdog/sp5100_tco.h
> index 2622cfe23dc1..cc00f1157220 100644
> --- a/drivers/watchdog/sp5100_tco.h
> +++ b/drivers/watchdog/sp5100_tco.h
> @@ -15,6 +15,8 @@
> #define SP5100_WDT_COUNT(base) ((base) + 0x04) /* Watchdog
> Count */
>
> #define SP5100_WDT_START_STOP_BIT (1 << 0)
> +#define SP5100_WDT_FIRED (1 << 1)
> +#define SP5100_WDT_ACTION_RESET (1 << 2)
> #define SP5100_WDT_TRIGGER_BIT (1 << 7)
>
> #define SP5100_PM_IOPORTS_SIZE 0x02
> @@ -34,9 +36,6 @@
> #define SP5100_PM_WATCHDOG_CONTROL 0x69
> #define SP5100_PM_WATCHDOG_BASE 0x6C
>
> -#define SP5100_PM_WATCHDOG_FIRED (1 << 1)
> -#define SP5100_PM_WATCHDOG_ACTION_RESET (1 << 2)
> -
> #define SP5100_PCI_WATCHDOG_MISC_REG 0x41
> #define SP5100_PCI_WATCHDOG_DECODE_EN (1 << 3)
>
--
Cheers,
Lyude Paul
next prev parent reply other threads:[~2018-01-16 20:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-24 21:04 [PATCH 00/12] watchdog: sp5100_tco: Various improvements Guenter Roeck
2017-12-24 21:04 ` [PATCH 01/12] watchdog: sp5100_tco: Always use SP5100_IO_PM_{INDEX_REG,DATA_REG} Guenter Roeck
2017-12-24 21:04 ` [PATCH 02/12] watchdog: sp5100_tco: Fix watchdog disable bit Guenter Roeck
2017-12-24 21:04 ` [PATCH 03/12] watchdog: sp5100_tco: Use request_muxed_region where possible Guenter Roeck
2018-01-16 19:44 ` [03/12] " Lyude Paul
2018-01-16 20:16 ` Guenter Roeck
2017-12-24 21:04 ` [PATCH 04/12] watchdog: sp5100_tco: Use standard error codes Guenter Roeck
2018-01-16 19:46 ` [04/12] " Lyude Paul
2017-12-24 21:04 ` [PATCH 05/12] watchdog: sp5100_tco: Clean up sp5100_tco_setupdevice Guenter Roeck
2018-01-16 19:55 ` [05/12] " Lyude Paul
2018-01-16 20:22 ` Guenter Roeck
2018-01-17 1:28 ` Guenter Roeck
2017-12-24 21:04 ` [PATCH 06/12] watchdog: sp5100_tco: Match PCI device early Guenter Roeck
2018-01-16 19:58 ` [06/12] " Lyude Paul
2017-12-24 21:04 ` [PATCH 07/12] watchdog: sp5100_tco: Use dev_ print functions where possible Guenter Roeck
2018-01-16 20:00 ` [07/12] " Lyude Paul
2017-12-24 21:04 ` [PATCH 08/12] watchdog: sp5100_tco: Clean up function and variable names Guenter Roeck
2018-01-16 20:05 ` Lyude Paul [this message]
2017-12-24 21:04 ` [PATCH 09/12] watchdog: sp5100_tco: Convert to use watchdog subsystem Guenter Roeck
2017-12-24 21:04 ` [PATCH 10/12] watchdog: sp5100_tco: Use bit operations Guenter Roeck
2017-12-24 21:04 ` [PATCH 11/12] watchdog: sp5100-tco: Abort if watchdog is disabled by hardware Guenter Roeck
2018-01-09 22:58 ` [11/12] " Lyude Paul
2018-01-09 23:37 ` Guenter Roeck
2018-01-09 23:58 ` Gabriel C
2018-01-10 0:05 ` Guenter Roeck
2018-01-10 1:26 ` Gabriel C
2018-01-10 2:09 ` Guenter Roeck
2018-01-10 2:41 ` Gabriel C
2018-01-10 5:02 ` Guenter Roeck
2018-01-10 0:04 ` Lyude Paul
2018-01-10 0:11 ` Guenter Roeck
2018-01-10 0:30 ` Lyude Paul
2017-12-24 21:04 ` [PATCH 12/12] watchdog: sp5100_tco: Add support for recent FCH versions Guenter Roeck
2018-01-04 12:01 ` Boszormenyi Zoltan
2018-01-04 19:21 ` Guenter Roeck
2018-01-10 8:34 ` Boszormenyi Zoltan
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=1516133156.18904.17.camel@redhat.com \
--to=lyude@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@iguana.be \
--cc=zboszor@pr.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.