]> git.sur5r.net Git - u-boot/commitdiff
sf: move useful messages from debug to printf
authorMike Frysinger <vapier@gentoo.org>
Thu, 29 Apr 2010 04:35:12 +0000 (00:35 -0400)
committerMike Frysinger <vapier@gentoo.org>
Thu, 1 Jul 2010 03:47:08 +0000 (23:47 -0400)
At the moment, the default SPI flash subsystem is quite terse.  Errors and
successes both result in a generic message.  So move the useful errors and
useful successes to printf output by default.

While we're here, also convert the messages to use print_size().

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
drivers/mtd/spi/atmel.c
drivers/mtd/spi/macronix.c
drivers/mtd/spi/spansion.c
drivers/mtd/spi/spi_flash.c
drivers/mtd/spi/sst.c
drivers/mtd/spi/stmicro.c
drivers/mtd/spi/winbond.c

index 8306c000d2398bdcbdb50d04eafe1927b99af135..8d0216956d7847b0063d9acdd698f6e6ef52178e 100644 (file)
@@ -467,7 +467,7 @@ out:
 struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
 {
        const struct atmel_spi_flash_params *params;
-       unsigned long page_size;
+       unsigned page_size;
        unsigned int family;
        struct atmel_spi_flash *asf;
        unsigned int i;
@@ -540,8 +540,9 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave *spi, u8 *idcode)
                                * params->blocks_per_sector
                                * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %lu, total %u bytes\n",
-                       params->name, page_size, asf->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, page_size);
+       print_size(asf->flash.size, "\n");
 
        return &asf->flash;
 
index fe1310bf9466fc3fcc582e6abe5ae6e0365cba32..76d52841d1ccbb99a3eeb595e465de1a926a3256 100644 (file)
@@ -330,8 +330,9 @@ struct spi_flash *spi_flash_probe_macronix(struct spi_slave *spi, u8 *idcode)
        mcx->flash.size = params->page_size * params->pages_per_sector
            * params->sectors_per_block * params->nr_blocks;
 
-       printf("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, params->page_size, mcx->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, params->page_size);
+       print_size(mcx->flash.size, "\n");
 
        return &mcx->flash;
 }
index fdb791798560edf65598c7423e423f0a5bb87bdc..d6c1a5f9d3addeab46a449b1d4da1b13ef1de8a4 100644 (file)
@@ -343,8 +343,9 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave *spi, u8 *idcode)
        spsn->flash.size = params->page_size * params->pages_per_sector
            * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, params->page_size, spsn->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, params->page_size);
+       print_size(spsn->flash.size, "\n");
 
        return &spsn->flash;
 }
index dd0dbbf01f479a40e24c8c23388a5eb9e309ee55..ea875dc812b4bcf34e41af00072ff3c8004207c0 100644 (file)
@@ -106,7 +106,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
 
        spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
        if (!spi) {
-               debug("SF: Failed to set up slave\n");
+               printf("SF: Failed to set up slave\n");
                return NULL;
        }
 
@@ -157,7 +157,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs,
                break;
 #endif
        default:
-               debug("SF: Unsupported manufacturer %02X\n", idcode[0]);
+               printf("SF: Unsupported manufacturer %02X\n", idcode[0]);
                flash = NULL;
                break;
        }
index 50e929918a824e0bf0a8903daa9b6055681feb18..25578914c68fab2b3a001b05b724e18e788b247b 100644 (file)
@@ -364,8 +364,9 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
        stm->flash.read = sst_read_fast;
        stm->flash.size = SST_SECTOR_SIZE * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, SST_SECTOR_SIZE, stm->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, SST_SECTOR_SIZE);
+       print_size(stm->flash.size, "\n");
 
        /* Flash powers up read-only, so clear BP# bits */
        sst_unlock(&stm->flash);
index 21e9b0084c1782820f2214dd07c87928d6e17bd4..31340279cb872f98e0fdafe84f087ff0dc0f7786 100644 (file)
@@ -365,8 +365,9 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave *spi, u8 * idcode)
        stm->flash.size = params->page_size * params->pages_per_sector
            * params->nr_sectors;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-             params->name, params->page_size, stm->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, params->page_size);
+       print_size(stm->flash.size, "\n");
 
        return &stm->flash;
 }
index b8da92319313d4db300baba57e65f6b8a0786793..ff1df25a1dfd47e9e635008ae2394b290348ac25 100644 (file)
@@ -289,7 +289,7 @@ out:
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
 {
        const struct winbond_spi_flash_params *params;
-       unsigned long page_size;
+       unsigned page_size;
        struct winbond_spi_flash *stm;
        unsigned int i;
 
@@ -325,8 +325,9 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
                                * params->sectors_per_block
                                * params->nr_blocks;
 
-       debug("SF: Detected %s with page size %u, total %u bytes\n",
-                       params->name, page_size, stm->flash.size);
+       printf("SF: Detected %s with page size %u, total ",
+              params->name, page_size);
+       print_size(stm->flash.size, "\n");
 
        return &stm->flash;
 }