summaryrefslogtreecommitdiffstats
path: root/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
commitccf8c6c79444108b45ed82d96b18cbdb6a8d2cff (patch)
treeb7417fb2e24f15ed90e8102301ff365a71852878 /chipset_enable.c
parent72c9668b9535bfe40d3e321faa26cfe5bb9a44b3 (diff)
downloadast2050-flashrom-ccf8c6c79444108b45ed82d96b18cbdb6a8d2cff.zip
ast2050-flashrom-ccf8c6c79444108b45ed82d96b18cbdb6a8d2cff.tar.gz
Check all mmap() calls and print helpful Linux error message
Corresponding to flashrom svn r386 and coreboot v2 svn r3890. Signed-off-by: Peter Stuge <peter@stuge.se> Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'chipset_enable.c')
-rw-r--r--chipset_enable.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/chipset_enable.c b/chipset_enable.c
index 52d1549..d7eb7fa 100644
--- a/chipset_enable.c
+++ b/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);
}
OpenPOWER on IntegriCloud