summaryrefslogtreecommitdiff
path: root/atahpt.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-01-04 22:24:58 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-01-04 22:24:58 +0000
commitfc2c3133fbb24b2e770c6f3bea0a850272a70bbe (patch)
tree5284fff71cacd837b0bea9b80977dee26a08765a /atahpt.c
parent56db1525df14792574a9847d22eaf1fea09a115e (diff)
downloadflashrom-fc2c3133fbb24b2e770c6f3bea0a850272a70bbe.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(). Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1642 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'atahpt.c')
-rw-r--r--atahpt.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/atahpt.c b/atahpt.c
index 461191d..d19cb75 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -56,13 +56,6 @@ static const struct par_programmer par_programmer_atahpt = {
.chip_writen = fallback_chip_writen,
};
-static int atahpt_shutdown(void *data)
-{
- /* Flash access is disabled automatically by PCI restore. */
- pci_cleanup(pacc);
- return 0;
-}
-
int atahpt_init(void)
{
uint32_t reg32;
@@ -72,9 +65,6 @@ int atahpt_init(void)
io_base_addr = pcidev_init(PCI_BASE_ADDRESS_4, ata_hpt);
- if (register_shutdown(atahpt_shutdown, NULL))
- return 1;
-
/* Enable flash access. */
reg32 = pci_read_long(pcidev_dev, REG_FLASH_ACCESS);
reg32 |= (1 << 24);