diff options
author | Mart Raudsepp <mart.raudsepp@artecdesign.ee> | 2008-02-11 14:32:45 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2008-02-11 14:32:45 +0000 |
commit | 3697ac75d5445c7ef66913cc3935f0bfe57a8d19 (patch) | |
tree | 4688ac422b600716a9e6b4ea170772c17b6f4775 | |
parent | 97866087ae2c5bab35d160d9e694ae4009479493 (diff) | |
download | flashrom-3697ac75d5445c7ef66913cc3935f0bfe57a8d19.tar.gz flashrom-3697ac75d5445c7ef66913cc3935f0bfe57a8d19.tar.bz2 flashrom-3697ac75d5445c7ef66913cc3935f0bfe57a8d19.zip |
Further cleanups to enable_flash_cs5536
- Remove the "enable write to flash" message, as the caller appears to
already report that.
- Move the 'modprobe msr' suggestions to the first lseek64 error handling, as
we get an error there already.
- Rename a perror string from "read" to "read msr", as we use the latter
already in this function for another read.
Corresponding to flashrom svn r195 and coreboot v2 svn r3101.
Signed-off-by: Mart Raudsepp <mart.raudsepp@artecdesign.ee>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
-rw-r--r-- | chipset_enable.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/chipset_enable.c b/chipset_enable.c index c9b09980..84cb191c 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -259,18 +259,17 @@ static int enable_flash_cs5536(struct pci_dev *dev, const char *name) if (lseek64(fd_msr, (off64_t) MSR_RCONF_DEFAULT, SEEK_SET) == -1) { perror("lseek64"); + printf("Cannot operate on MSR. Did you run 'modprobe msr'?\n"); close(fd_msr); return -1; } if (read(fd_msr, buf, 8) != 8) { - perror("read"); + perror("read msr"); close(fd_msr); return -1; } - printf("Enabling Geode MSR to write to flash.\n"); - if (buf[7] != 0x22) { buf[7] &= 0xfb; if (lseek64(fd_msr, (off64_t) MSR_RCONF_DEFAULT, SEEK_SET) == -1) { @@ -281,7 +280,6 @@ static int enable_flash_cs5536(struct pci_dev *dev, const char *name) if (write(fd_msr, buf, 8) < 0) { perror("msr write"); - printf("Cannot write to MSR. Did you run 'modprobe msr'?\n"); close(fd_msr); return -1; } @@ -309,7 +307,6 @@ static int enable_flash_cs5536(struct pci_dev *dev, const char *name) } if (write(fd_msr, buf, 8) < 0) { perror("msr write"); - printf("Cannot write to MSR. Did you run 'modprobe msr'?\n"); close(fd_msr); return -1; } |