aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/jedec_probe.c
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-07-19 13:06:09 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:16 -0400
commit289c05222172b51401dbbb017115655f241d94ab (patch)
tree1fd2c801102a8c4a085f75a08c766d3250491962 /drivers/mtd/chips/jedec_probe.c
parentd037021953922ebdbc34b98b8c4648017b1c6e89 (diff)
mtd: replace DEBUG() with pr_debug()
Start moving away from the MTD_DEBUG_LEVEL messages. The dynamic debugging feature is a generic kernel feature that provides more flexibility. (See Documentation/dynamic-debug-howto.txt) Also fix some punctuation, indentation, and capitalization that went along with the affected lines. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'drivers/mtd/chips/jedec_probe.c')
-rw-r--r--drivers/mtd/chips/jedec_probe.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/mtd/chips/jedec_probe.c b/drivers/mtd/chips/jedec_probe.c
index d40c410a3241..c443f527a53a 100644
--- a/drivers/mtd/chips/jedec_probe.c
+++ b/drivers/mtd/chips/jedec_probe.c
@@ -1917,8 +1917,7 @@ static void jedec_reset(u32 base, struct map_info *map, struct cfi_private *cfi)
1917 * as they will ignore the writes and don't care what address 1917 * as they will ignore the writes and don't care what address
1918 * the F0 is written to */ 1918 * the F0 is written to */
1919 if (cfi->addr_unlock1) { 1919 if (cfi->addr_unlock1) {
1920 DEBUG( MTD_DEBUG_LEVEL3, 1920 pr_debug( "reset unlock called %x %x \n",
1921 "reset unlock called %x %x \n",
1922 cfi->addr_unlock1,cfi->addr_unlock2); 1921 cfi->addr_unlock1,cfi->addr_unlock2);
1923 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 1922 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
1924 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); 1923 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
@@ -1941,7 +1940,7 @@ static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int in
1941 uint8_t uaddr; 1940 uint8_t uaddr;
1942 1941
1943 if (!(jedec_table[index].devtypes & cfi->device_type)) { 1942 if (!(jedec_table[index].devtypes & cfi->device_type)) {
1944 DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n", 1943 pr_debug("Rejecting potential %s with incompatible %d-bit device type\n",
1945 jedec_table[index].name, 4 * (1<<cfi->device_type)); 1944 jedec_table[index].name, 4 * (1<<cfi->device_type));
1946 return 0; 1945 return 0;
1947 } 1946 }
@@ -2021,7 +2020,7 @@ static inline int jedec_match( uint32_t base,
2021 * there aren't. 2020 * there aren't.
2022 */ 2021 */
2023 if (finfo->dev_id > 0xff) { 2022 if (finfo->dev_id > 0xff) {
2024 DEBUG( MTD_DEBUG_LEVEL3, "%s(): ID is not 8bit\n", 2023 pr_debug("%s(): ID is not 8bit\n",
2025 __func__); 2024 __func__);
2026 goto match_done; 2025 goto match_done;
2027 } 2026 }
@@ -2045,12 +2044,10 @@ static inline int jedec_match( uint32_t base,
2045 } 2044 }
2046 2045
2047 /* the part size must fit in the memory window */ 2046 /* the part size must fit in the memory window */
2048 DEBUG( MTD_DEBUG_LEVEL3, 2047 pr_debug("MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
2049 "MTD %s(): Check fit 0x%.8x + 0x%.8x = 0x%.8x\n",
2050 __func__, base, 1 << finfo->dev_size, base + (1 << finfo->dev_size) ); 2048 __func__, base, 1 << finfo->dev_size, base + (1 << finfo->dev_size) );
2051 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) { 2049 if ( base + cfi_interleave(cfi) * ( 1 << finfo->dev_size ) > map->size ) {
2052 DEBUG( MTD_DEBUG_LEVEL3, 2050 pr_debug("MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
2053 "MTD %s(): 0x%.4x 0x%.4x %dKiB doesn't fit\n",
2054 __func__, finfo->mfr_id, finfo->dev_id, 2051 __func__, finfo->mfr_id, finfo->dev_id,
2055 1 << finfo->dev_size ); 2052 1 << finfo->dev_size );
2056 goto match_done; 2053 goto match_done;
@@ -2061,13 +2058,12 @@ static inline int jedec_match( uint32_t base,
2061 2058
2062 uaddr = finfo->uaddr; 2059 uaddr = finfo->uaddr;
2063 2060
2064 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n", 2061 pr_debug("MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n",
2065 __func__, cfi->addr_unlock1, cfi->addr_unlock2 ); 2062 __func__, cfi->addr_unlock1, cfi->addr_unlock2 );
2066 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr 2063 if ( MTD_UADDR_UNNECESSARY != uaddr && MTD_UADDR_DONT_CARE != uaddr
2067 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 || 2064 && ( unlock_addrs[uaddr].addr1 / cfi->device_type != cfi->addr_unlock1 ||
2068 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) { 2065 unlock_addrs[uaddr].addr2 / cfi->device_type != cfi->addr_unlock2 ) ) {
2069 DEBUG( MTD_DEBUG_LEVEL3, 2066 pr_debug("MTD %s(): 0x%.4x 0x%.4x did not match\n",
2070 "MTD %s(): 0x%.4x 0x%.4x did not match\n",
2071 __func__, 2067 __func__,
2072 unlock_addrs[uaddr].addr1, 2068 unlock_addrs[uaddr].addr1,
2073 unlock_addrs[uaddr].addr2); 2069 unlock_addrs[uaddr].addr2);
@@ -2083,15 +2079,13 @@ static inline int jedec_match( uint32_t base,
2083 * FIXME - write a driver that takes all of the chip info as 2079 * FIXME - write a driver that takes all of the chip info as
2084 * module parameters, doesn't probe but forces a load. 2080 * module parameters, doesn't probe but forces a load.
2085 */ 2081 */
2086 DEBUG( MTD_DEBUG_LEVEL3, 2082 pr_debug("MTD %s(): check ID's disappear when not in ID mode\n",
2087 "MTD %s(): check ID's disappear when not in ID mode\n",
2088 __func__ ); 2083 __func__ );
2089 jedec_reset( base, map, cfi ); 2084 jedec_reset( base, map, cfi );
2090 mfr = jedec_read_mfr( map, base, cfi ); 2085 mfr = jedec_read_mfr( map, base, cfi );
2091 id = jedec_read_id( map, base, cfi ); 2086 id = jedec_read_id( map, base, cfi );
2092 if ( mfr == cfi->mfr && id == cfi->id ) { 2087 if ( mfr == cfi->mfr && id == cfi->id ) {
2093 DEBUG( MTD_DEBUG_LEVEL3, 2088 pr_debug("MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n"
2094 "MTD %s(): ID 0x%.2x:0x%.2x did not change after reset:\n"
2095 "You might need to manually specify JEDEC parameters.\n", 2089 "You might need to manually specify JEDEC parameters.\n",
2096 __func__, cfi->mfr, cfi->id ); 2090 __func__, cfi->mfr, cfi->id );
2097 goto match_done; 2091 goto match_done;
@@ -2104,7 +2098,7 @@ static inline int jedec_match( uint32_t base,
2104 * Put the device back in ID mode - only need to do this if we 2098 * Put the device back in ID mode - only need to do this if we
2105 * were truly frobbing a real device. 2099 * were truly frobbing a real device.
2106 */ 2100 */
2107 DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): return to ID mode\n", __func__ ); 2101 pr_debug("MTD %s(): return to ID mode\n", __func__ );
2108 if (cfi->addr_unlock1) { 2102 if (cfi->addr_unlock1) {
2109 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL); 2103 cfi_send_gen_cmd(0xaa, cfi->addr_unlock1, base, map, cfi, cfi->device_type, NULL);
2110 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL); 2104 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, base, map, cfi, cfi->device_type, NULL);
@@ -2167,13 +2161,11 @@ static int jedec_probe_chip(struct map_info *map, __u32 base,
2167 2161
2168 cfi->mfr = jedec_read_mfr(map, base, cfi); 2162 cfi->mfr = jedec_read_mfr(map, base, cfi);
2169 cfi->id = jedec_read_id(map, base, cfi); 2163 cfi->id = jedec_read_id(map, base, cfi);
2170 DEBUG(MTD_DEBUG_LEVEL3, 2164 pr_debug("Search for id:(%02x %02x) interleave(%d) type(%d)\n",
2171 "Search for id:(%02x %02x) interleave(%d) type(%d)\n",
2172 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type); 2165 cfi->mfr, cfi->id, cfi_interleave(cfi), cfi->device_type);
2173 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) { 2166 for (i = 0; i < ARRAY_SIZE(jedec_table); i++) {
2174 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) { 2167 if ( jedec_match( base, map, cfi, &jedec_table[i] ) ) {
2175 DEBUG( MTD_DEBUG_LEVEL3, 2168 pr_debug("MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
2176 "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n",
2177 __func__, cfi->mfr, cfi->id, 2169 __func__, cfi->mfr, cfi->id,
2178 cfi->addr_unlock1, cfi->addr_unlock2 ); 2170 cfi->addr_unlock1, cfi->addr_unlock2 );
2179 if (!cfi_jedec_setup(map, cfi, i)) 2171 if (!cfi_jedec_setup(map, cfi, i))