Alexander Goncharov has uploaded this change for review.

View Change

ni845x_spi: introduce a separate func for cleaning up

TODO: desc

TOPIC=register_master_api

Change-Id: I8b32129b8d0dff9a7516973893fa4bf92f9e64db
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
---
M ni845x_spi.c
1 file changed, 22 insertions(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/59/72159/1
diff --git a/ni845x_spi.c b/ni845x_spi.c
index 0a5c46d..de907af 100644
--- a/ni845x_spi.c
+++ b/ni845x_spi.c
@@ -386,7 +386,7 @@
ni845x_report_error("ni845xCloseFindDeviceHandle", tmp);
}

-static int ni845x_spi_shutdown(void *data)
+static void ni845x_spi_cleanup(NiHandle configuration_handle, uInt32 device_handle)
{
int32 ret = 0;

@@ -401,6 +401,12 @@
if (ret)
ni845x_report_error("ni845xClose", ret);
}
+}
+
+static int ni845x_spi_shutdown(void *data)
+{
+ ni845x_spi_cleanup(configuration_handle, device_handle);
+
return 0;
}

@@ -630,7 +636,7 @@
return register_spi_master(&spi_programmer_ni845x, NULL);

err:
- ni845x_spi_shutdown(NULL);
+ ni845x_spi_cleanup(configuration_handle, device_handle);
return 1;
}


To view, visit change 72159. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I8b32129b8d0dff9a7516973893fa4bf92f9e64db
Gerrit-Change-Number: 72159
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Goncharov <chat@joursoir.net>
Gerrit-MessageType: newchange