diff options
author | Anastasia Klimchuk <aklm@chromium.org> | 2021-06-28 17:03:52 +1000 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2021-06-30 08:12:54 +0000 |
commit | 6814e2c2820cb065db195c07cf51749f6ae85137 (patch) | |
tree | 5cf5abd32d5fdcc235932329d73511aae40a7765 /pcidev.c | |
parent | 92b30ba80001e13356ef7e5d87738fb226dddc40 (diff) | |
download | flashrom-6814e2c2820cb065db195c07cf51749f6ae85137.tar.gz flashrom-6814e2c2820cb065db195c07cf51749f6ae85137.tar.bz2 flashrom-6814e2c2820cb065db195c07cf51749f6ae85137.zip |
dediprog: 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
https://review.coreboot.org/c/flashrom/+/51761
BUG=b:185191942
TEST=builds
Change-Id: I3273da907614a042d50090338c337dfd64695354
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55887
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'pcidev.c')
0 files changed, 0 insertions, 0 deletions