Changeset 1561


Ignore:
Timestamp:
Aug 3, 2012 1:56:49 AM (11 months ago)
Author:
stefanct
Message:

Refine messages of SPI block protection disables.

Make them real progress indicators with a final "done" message on success.

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/at25.c

    r1560 r1561  
    165165                return 0; 
    166166 
    167         msg_cdbg("Some block protection in effect, disabling\n"); 
     167        msg_cdbg("Some block protection in effect, disabling... "); 
    168168        if (status & (1 << 7)) { 
    169169                msg_cdbg("Need to disable Sector Protection Register Lock\n"); 
     
    176176                result = spi_write_status_register(flash, status & ~(1 << 7)); 
    177177                if (result) { 
    178                         msg_cerr("spi_write_status_register failed\n"); 
     178                        msg_cerr("spi_write_status_register failed.\n"); 
    179179                        return result; 
    180180                } 
     
    184184        result = spi_write_status_register(flash, status & ~0xbc); 
    185185        if (result) { 
    186                 msg_cerr("spi_write_status_register failed\n"); 
     186                msg_cerr("spi_write_status_register failed.\n"); 
    187187                return result; 
    188188        } 
     
    192192                return 1; 
    193193        } 
     194        msg_cdbg("done.\n"); 
    194195        return 0; 
    195196} 
     
    220221                return 0; 
    221222 
    222         msg_cdbg("Some block protection in effect, disabling\n"); 
     223        msg_cdbg("Some block protection in effect, disabling... "); 
    223224        if (status & (1 << 7)) { 
    224225                msg_cdbg("Need to disable Status Register Write Protect\n"); 
     
    226227                result = spi_write_status_register(flash, status & ~(1 << 7)); 
    227228                if (result) { 
    228                         msg_cerr("spi_write_status_register failed\n"); 
     229                        msg_cerr("spi_write_status_register failed.\n"); 
    229230                        return result; 
    230231                } 
     
    233234        result = spi_write_status_register(flash, status & ~0xec); 
    234235        if (result) { 
    235                 msg_cerr("spi_write_status_register failed\n"); 
     236                msg_cerr("spi_write_status_register failed.\n"); 
    236237                return result; 
    237238        } 
     
    241242                return 1; 
    242243        } 
     244        msg_cdbg("done.\n"); 
    243245        return 0; 
    244246} 
     
    254256                return 0; 
    255257 
    256         msg_cdbg("Some block protection in effect, disabling\n"); 
     258        msg_cdbg("Some block protection in effect, disabling... "); 
    257259        if (status & (1 << 7)) { 
    258260                msg_cdbg("Need to disable Status Register Write Protect\n"); 
     
    260262                result = spi_write_status_register(flash, status & ~(1 << 7)); 
    261263                if (result) { 
    262                         msg_cerr("spi_write_status_register failed\n"); 
     264                        msg_cerr("spi_write_status_register failed.\n"); 
    263265                        return result; 
    264266                } 
     
    267269        result = spi_write_status_register(flash, status & ~0xfc); 
    268270        if (result) { 
    269                 msg_cerr("spi_write_status_register failed\n"); 
     271                msg_cerr("spi_write_status_register failed.\n"); 
    270272                return result; 
    271273        } 
     
    275277                return 1; 
    276278        } 
    277         return 0; 
    278 } 
     279        msg_cdbg("done.\n"); 
     280        return 0; 
     281} 
  • trunk/spi25.c

    r1560 r1561  
    934934                return 0; 
    935935 
    936         msg_cdbg("Some block protection in effect, disabling\n"); 
     936        msg_cdbg("Some block protection in effect, disabling... "); 
    937937        result = spi_write_status_register(flash, status & ~0x3c); 
    938938        if (result) { 
    939                 msg_cerr("spi_write_status_register failed\n"); 
     939                msg_cerr("spi_write_status_register failed.\n"); 
    940940                return result; 
    941941        } 
     
    945945                return 1; 
    946946        } 
     947        msg_cdbg("done.\n"); 
    947948        return 0; 
    948949} 
Note: See TracChangeset for help on using the changeset viewer.