mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 22:21:16 +02:00
Automatically unmap physmap()s
Similarly to the previous PCI self-clean up patch this one allows to get rid of a huge number of programmer shutdown functions and makes introducing bugs harder. It adds a new function rphysmap() that takes care of unmapping at shutdown. Callers are changed where it makes sense. Corresponding to flashrom svn r1714. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
11
satamv.c
11
satamv.c
@ -57,12 +57,6 @@ static const struct par_programmer par_programmer_satamv = {
|
||||
.chip_writen = fallback_chip_writen,
|
||||
};
|
||||
|
||||
static int satamv_shutdown(void *data)
|
||||
{
|
||||
physunmap(mv_bar, 0x20000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Random notes:
|
||||
* FCE# Flash Chip Enable
|
||||
@ -94,13 +88,10 @@ int satamv_init(void)
|
||||
return 1;
|
||||
|
||||
addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
|
||||
mv_bar = physmap("Marvell 88SX7042 registers", addr, 0x20000);
|
||||
mv_bar = rphysmap("Marvell 88SX7042 registers", addr, 0x20000);
|
||||
if (mv_bar == ERROR_PTR)
|
||||
return 1;
|
||||
|
||||
if (register_shutdown(satamv_shutdown, NULL))
|
||||
return 1;
|
||||
|
||||
tmp = pci_mmio_readl(mv_bar + FLASH_PARAM);
|
||||
msg_pspew("Flash Parameters:\n");
|
||||
msg_pspew("TurnOff=0x%01x\n", (tmp >> 0) & 0x7);
|
||||
|
Reference in New Issue
Block a user