summaryrefslogtreecommitdiffstats
path: root/ichspi.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-08-14 15:48:44 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2013-08-14 15:48:44 +0000
commit7fb5aa049bee3c685835dc24c8184c5897e4a6bd (patch)
tree3d193e98d25da24307824ab8d0939f3538ec2e50 /ichspi.c
parent36e9f4b3595c6e8b13f80f85785a91b65ecad62f (diff)
downloadast2050-flashrom-7fb5aa049bee3c685835dc24c8184c5897e4a6bd.zip
ast2050-flashrom-7fb5aa049bee3c685835dc24c8184c5897e4a6bd.tar.gz
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>
Diffstat (limited to 'ichspi.c')
-rw-r--r--ichspi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ichspi.c b/ichspi.c
index 6d1bd1a..1dcff5b 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1844,7 +1844,9 @@ int via_init_spi(struct pci_dev *dev, uint32_t mmio_base)
{
int i;
- ich_spibar = physmap("VIA SPI MMIO registers", mmio_base, 0x70);
+ ich_spibar = rphysmap("VIA SPI MMIO registers", mmio_base, 0x70);
+ if (ich_spibar == ERROR_PTR)
+ return ERROR_FATAL;
/* Do we really need no write enable? Like the LPC one at D17F0 0x40 */
/* Not sure if it speaks all these bus protocols. */
OpenPOWER on IntegriCloud