soc: aspeed: lpc-snoop: Consolidate channel initialisation
authorAndrew Jeffery <andrew@codeconstruct.com.au>
Mon, 16 Jun 2025 13:13:46 +0000 (22:43 +0930)
committerAndrew Jeffery <andrew@codeconstruct.com.au>
Tue, 8 Jul 2025 02:05:07 +0000 (11:35 +0930)
commit4483e3c481bd2d026813434f3cd93381386cd1fa
treededaab3e04a015bcfdf1e4b61854d53816fd9b0e
parentfa4ffb06d8e4c243ca1073d321068ee8ab384b4b
soc: aspeed: lpc-snoop: Consolidate channel initialisation

Previously, channel initialisation was a bit perilous with respect to
resource cleanup in error paths. While the implementation had issues,
it at least made an effort to eliminate some of its problems by first
testing whether any channels were enabled, and bailing out if not.

Having improved the robustness of resource handling in probe() we can
now rearrange the initial channel test to be located with the subsequent
test, and rework the unrolled conditional logic to use a loop for an
improvement in readability.

Link: https://patch.msgid.link/20250616-aspeed-lpc-snoop-fixes-v2-9-3cdd59c934d3@codeconstruct.com.au
Acked-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
drivers/soc/aspeed/aspeed-lpc-snoop.c