Changeset 1435 for trunk


Ignore:
Timestamp:
09/09/11 14:46:32 (8 months ago)
Author:
stefanct
Message:

Revamp the warning of failing to set BIOS write enable in enable_flash_ich

  • introduce a new variable 'wanted' that is used instead of 'new'
  • use 'new' for the actual value contained in BIOS_CNTL after we tried to write it
  • rephrase the warning which now also includes the old and new values besides the wanted one

Signed-off-by: Stefan Tauner <stefan.tauner@…>
Acked-by: Uwe Hermann <uwe@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/chipset_enable.c

    r1430 r1435  
    257257                            int bios_cntl) 
    258258{ 
    259         uint8_t old, new; 
     259        uint8_t old, new, wanted; 
    260260 
    261261        /* 
     
    281281                msg_pinfo("WARNING: BIOS region SMM protection is enabled!\n"); 
    282282 
    283         new = old | 1; 
    284         if (new == old) 
     283        wanted = old | 1; 
     284        if (wanted == old) 
    285285                return 0; 
    286286 
    287         rpci_write_byte(dev, bios_cntl, new); 
    288  
    289         if (pci_read_byte(dev, bios_cntl) != new) { 
    290                 msg_pinfo("Setting register 0x%x to 0x%x on %s failed " 
    291                           "(WARNING ONLY).\n", bios_cntl, new, name); 
     287        rpci_write_byte(dev, bios_cntl, wanted); 
     288 
     289        if ((new = pci_read_byte(dev, bios_cntl)) != wanted) { 
     290                msg_pinfo("WARNING: Setting 0x%x from 0x%x to 0x%x on %s " 
     291                          "failed. New value is 0x%x.\n", 
     292                          bios_cntl, old, wanted, name, new); 
    292293                return -1; 
    293294        } 
Note: See TracChangeset for help on using the changeset viewer.