summaryrefslogtreecommitdiffstats
path: root/sb600spi.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
commit1e06de6c07849b4fe92ad38d6cc9d4307f1ceb98 (patch)
tree3d193e98d25da24307824ab8d0939f3538ec2e50 /sb600spi.c
parent2a691febad07af468248a5f451347cfdf196b1b3 (diff)
downloadflashrom-1e06de6c07849b4fe92ad38d6cc9d4307f1ceb98.zip
flashrom-1e06de6c07849b4fe92ad38d6cc9d4307f1ceb98.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 'sb600spi.c')
-rw-r--r--sb600spi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sb600spi.c b/sb600spi.c
index cb7c4ac..dcf1b3c 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -326,8 +326,10 @@ int sb600_probe_spi(struct pci_dev *dev)
return 0;
/* Physical memory has to be mapped at page (4k) boundaries. */
- sb600_spibar = physmap("SB600 SPI registers", tmp & 0xfffff000,
- 0x1000);
+ sb600_spibar = rphysmap("SB600 SPI registers", tmp & 0xfffff000, 0x1000);
+ if (sb600_spibar == ERROR_PTR)
+ return 1;
+
/* The low bits of the SPI base address are used as offset into
* the mapped page.
*/
OpenPOWER on IntegriCloud