flashrom: further cleanups to enable_flash_cs5536
authorMart Raudsepp <mart.raudsepp@artecdesign.ee>
Mon, 11 Feb 2008 14:32:45 +0000 (14:32 +0000)
committerUwe Hermann <uwe@hermann-uwe.de>
Mon, 11 Feb 2008 14:32:45 +0000 (14:32 +0000)
 - 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.

Signed-off-by: Mart Raudsepp <mart.raudsepp@artecdesign.ee>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3101 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/flashrom/chipset_enable.c

index c9b09980c4a41d6445b291acdb6b0d7c11daa9a5..84cb191cf650c5d45a5368c99c335f310c74d154 100644 (file)
@@ -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;
        }