Watchdog: sp5100_tco: Refactor MMIO base address initialization
authorTerry Bowman <terry.bowman@amd.com>
Wed, 2 Feb 2022 15:35:23 +0000 (09:35 -0600)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 27 Mar 2022 15:04:32 +0000 (17:04 +0200)
commit1f182aca230086d4a4469c0f9136a6ea762d6385
treea259bd0506d419869dd0d64477099c2353339da6
parentabd71a948f7aab47ca49d3e7fe6afa6c48c8aae0
Watchdog: sp5100_tco: Refactor MMIO base address initialization

Combine MMIO base address and alternate base address detection. Combine
based on layout type. This will simplify the function by eliminating
a switch case.

Move existing request/release code into functions. This currently only
supports port I/O request/release. The move into a separate function
will make it ready for adding MMIO region support.

Co-developed-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
Signed-off-by: Terry Bowman <terry.bowman@amd.com>
Tested-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20220202153525.1693378-3-terry.bowman@amd.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/sp5100_tco.c
drivers/watchdog/sp5100_tco.h