summaryrefslogtreecommitdiffstats
path: root/satamv.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-01-04 22:24:58 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-01-04 22:24:58 +0000
commit5561955b1158e8bd29299735abef1e26a5a9cdbc (patch)
tree5284fff71cacd837b0bea9b80977dee26a08765a /satamv.c
parent30dfdbaf3ab30974a6d76e085525d52c033e4215 (diff)
downloadast2050-flashrom-5561955b1158e8bd29299735abef1e26a5a9cdbc.zip
ast2050-flashrom-5561955b1158e8bd29299735abef1e26a5a9cdbc.tar.gz
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 <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'satamv.c')
-rw-r--r--satamv.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/satamv.c b/satamv.c
index c0c1ffa..46a0e2d 100644
--- a/satamv.c
+++ b/satamv.c
@@ -60,7 +60,6 @@ static const struct par_programmer par_programmer_satamv = {
static int satamv_shutdown(void *data)
{
physunmap(mv_bar, 0x20000);
- pci_cleanup(pacc);
return 0;
}
@@ -96,7 +95,7 @@ int satamv_init(void)
mv_bar = physmap("Marvell 88SX7042 registers", addr, 0x20000);
if (mv_bar == ERROR_PTR)
- goto error_out;
+ return 1;
if (register_shutdown(satamv_shutdown, NULL))
return 1;
@@ -159,10 +158,6 @@ int satamv_init(void)
register_par_programmer(&par_programmer_satamv, BUS_PARALLEL);
return 0;
-
-error_out:
- pci_cleanup(pacc);
- return 1;
}
/* BAR2 (MEM) can map NVRAM and flash. We set it to flash in the init function.
OpenPOWER on IntegriCloud