path: root/drkaiser.c
diff options
authorStefan Tauner <>2013-01-04 22:24:58 +0000
committerStefan Tauner <>2013-01-04 22:24:58 +0000
commit5561955b1158e8bd29299735abef1e26a5a9cdbc (patch)
tree5284fff71cacd837b0bea9b80977dee26a08765a /drkaiser.c
parent30dfdbaf3ab30974a6d76e085525d52c033e4215 (diff)
Unify PCI init and let pcidev clean itself up
Previously the internal programmer used its own code to initialize pcilib. This patch extracts the common code from the internal programmer and pcidev_init() into pcidev_init_common(). This fixes the non-existent PCI cleanup of the internal programmer and adds an additional safety by checking for an already existing PCI context. We got a nice shutdown function registration infrastructure, but did not use it very wisely. Instead we added shutdown functions to a myriad of programmers unnecessarily. In this patch we get rid of those that do only call pci_cleanup(pacc) by adding a shutdown function the pcidev.c itself that gets registered by pcidev_init(). Corresponding to flashrom svn r1642. Signed-off-by: Stefan Tauner <> Acked-by: Carl-Daniel Hailfinger <>
Diffstat (limited to 'drkaiser.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/drkaiser.c b/drkaiser.c
index e461061..a6eca1c 100644
--- a/drkaiser.c
+++ b/drkaiser.c
@@ -59,8 +59,6 @@ static const struct par_programmer par_programmer_drkaiser = {
static int drkaiser_shutdown(void *data)
physunmap(drkaiser_bar, DRKAISER_MEMMAP_SIZE);
- /* Flash write is disabled automatically by PCI restore. */
- pci_cleanup(pacc);
return 0;
@@ -71,6 +69,7 @@ int drkaiser_init(void)
if (rget_io_perms())
return 1;
+ /* No need to check for errors, pcidev_init() will not return in case of errors. */
addr = pcidev_init(PCI_BASE_ADDRESS_2, drkaiser_pcidev);
/* Write magic register to enable flash write. */
OpenPOWER on IntegriCloud