summaryrefslogtreecommitdiff
path: root/it85spi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-08-14 15:48:44 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-08-14 15:48:44 +0000
commit4a3c6b6f549261535ba5f675d946f1bc7711881e (patch)
tree3d193e98d25da24307824ab8d0939f3538ec2e50 /it85spi.c
parentc1add0aad8d30137813415423fdd7c206e1237e5 (diff)
downloadflashrom-4a3c6b6f549261535ba5f675d946f1bc7711881e.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. 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@1714 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'it85spi.c')
-rw-r--r--it85spi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/it85spi.c b/it85spi.c
index 0b074eb..7efc680 100644
--- a/it85spi.c
+++ b/it85spi.c
@@ -262,6 +262,9 @@ static int it85xx_spi_common_init(struct superio s)
* Major TODO here, and it will be a lot of work.
*/
base = (chipaddr)physmap("it85 communication", 0xFFFFF000, 0x1000);
+ if (base == (chipaddr)ERROR_PTR)
+ return 1;
+
msg_pdbg("%s():%d base=0x%08x\n", __func__, __LINE__,
(unsigned int)base);
ce_high = (unsigned char *)(base + 0xE00); /* 0xFFFFFE00 */