summaryrefslogtreecommitdiff
path: root/util/flashrom/chipset_enable.c
diff options
context:
space:
mode:
authorPeter Stuge <peter@stuge.se>2009-01-23 05:23:06 +0000
committerPeter Stuge <peter@stuge.se>2009-01-23 05:23:06 +0000
commit2e5481356f7e0f925dfe935e6d7a7f1cdd3681ec (patch)
tree9e1ce79349326615b1dc272c275b8b243d03e559 /util/flashrom/chipset_enable.c
parent8a681b1d840e701e41892f8375a15baf56107ab5 (diff)
flashrom: Check all mmap() calls and print helpful Linux error message.
Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3890 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/chipset_enable.c')
-rw-r--r--util/flashrom/chipset_enable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/flashrom/chipset_enable.c b/util/flashrom/chipset_enable.c
index 52d154961e..d7eb7fa13d 100644
--- a/util/flashrom/chipset_enable.c
+++ b/util/flashrom/chipset_enable.c
@@ -220,6 +220,7 @@ static int enable_flash_vt8237s_spi(struct pci_dev *dev, const char *name)
if (spibar == MAP_FAILED) {
perror("Can't mmap memory using " MEM_DEV);
+ mmap_errmsg();
exit(1);
}
@@ -255,6 +256,7 @@ static int enable_flash_ich_dc_spi(struct pci_dev *dev, const char *name,
(off_t) tmp);
if (rcrb == MAP_FAILED) {
perror("Can't mmap memory using " MEM_DEV);
+ mmap_errmsg();
exit(1);
}
@@ -681,6 +683,7 @@ static int enable_flash_sb600(struct pci_dev *dev, const char *name)
fd_mem, (off_t)tmp);
if (sb600_spibar == MAP_FAILED) {
perror("Can't mmap memory using " MEM_DEV);
+ mmap_errmsg();
exit(1);
}
sb600_spibar += low_bits;
@@ -837,6 +840,7 @@ static int get_flashbase_sc520(struct pci_dev *dev, const char *name)
if (mmcr == MAP_FAILED) {
perror("Can't mmap Elan SC520 specific registers using " MEM_DEV);
+ mmap_errmsg();
exit(1);
}