diff options
author | Anastasia Klimchuk <aklm@chromium.org> | 2021-04-14 09:52:36 +1000 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2021-04-16 08:52:00 +0000 |
commit | 267ca96a91e7cb5e1e330f2ffa2cfb3b9f8d8aa2 (patch) | |
tree | a45ec8c2dfa4c5c75887b429ac543c24e63a416c /it87spi.c | |
parent | 9dad8c2143e6054b7c198aab5f622318a61bede4 (diff) | |
download | flashrom-267ca96a91e7cb5e1e330f2ffa2cfb3b9f8d8aa2.tar.gz flashrom-267ca96a91e7cb5e1e330f2ffa2cfb3b9f8d8aa2.tar.bz2 flashrom-267ca96a91e7cb5e1e330f2ffa2cfb3b9f8d8aa2.zip |
jlink_spi.c: Separate shutdown from failed init cleanup
Shutdown function was covering two different jobs here:
1) the actual shutdown which is run at the end of the driver's
lifecycle and 2) cleanup in cases when initialisation failed.
Now, shutdown is only doing its main job (#1), and the driver
itself is doing cleanup when init fails (#2).
The good thing is that now resources are released/closed immediately
in cases when init fails (vs shutdown function which was run at some
point later), and the driver leaves clean space after itself
if init fails.
And very importantly this unlocks API change which plans to move
register_shutdown inside register master API, see this
https://review.coreboot.org/c/flashrom/+/51761
TEST=builds
BUG=b:185191942
Change-Id: I71f64ed38154af670d4d28b8c7914d87fbc75679
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52308
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'it87spi.c')
0 files changed, 0 insertions, 0 deletions