Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[MTD] [NOR] Rename and export new cfi_qry_*() functions

They need to be exported, so let's give them less generic-sounding names
while we're at it.

Original export patch, along with the suggestion about the nomenclature,
from Stephen Rothwell.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

+31 -27
+10 -10
drivers/mtd/chips/cfi_probe.c
··· 44 44 45 45 #define xip_enable(base, map, cfi) \ 46 46 do { \ 47 - qry_mode_off(base, map, cfi); \ 47 + cfi_qry_mode_off(base, map, cfi); \ 48 48 xip_allowed(base, map); \ 49 49 } while (0) 50 50 51 51 #define xip_disable_qry(base, map, cfi) \ 52 52 do { \ 53 53 xip_disable(); \ 54 - qry_mode_on(base, map, cfi); \ 54 + cfi_qry_mode_on(base, map, cfi); \ 55 55 } while (0) 56 56 57 57 #else ··· 87 87 } 88 88 89 89 xip_disable(); 90 - if (!qry_mode_on(base, map, cfi)) { 90 + if (!cfi_qry_mode_on(base, map, cfi)) { 91 91 xip_enable(base, map, cfi); 92 92 return 0; 93 93 } ··· 108 108 start = i << cfi->chipshift; 109 109 /* This chip should be in read mode if it's one 110 110 we've already touched. */ 111 - if (qry_present(map, start, cfi)) { 111 + if (cfi_qry_present(map, start, cfi)) { 112 112 /* Eep. This chip also had the QRY marker. 113 113 * Is it an alias for the new one? */ 114 - qry_mode_off(start, map, cfi); 114 + cfi_qry_mode_off(start, map, cfi); 115 115 116 116 /* If the QRY marker goes away, it's an alias */ 117 - if (!qry_present(map, start, cfi)) { 117 + if (!cfi_qry_present(map, start, cfi)) { 118 118 xip_allowed(base, map); 119 119 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n", 120 120 map->name, base, start); ··· 124 124 * unfortunate. Stick the new chip in read mode 125 125 * too and if it's the same, assume it's an alias. */ 126 126 /* FIXME: Use other modes to do a proper check */ 127 - qry_mode_off(base, map, cfi); 127 + cfi_qry_mode_off(base, map, cfi); 128 128 129 - if (qry_present(map, base, cfi)) { 129 + if (cfi_qry_present(map, base, cfi)) { 130 130 xip_allowed(base, map); 131 131 printk(KERN_DEBUG "%s: Found an alias at 0x%x for the chip at 0x%lx\n", 132 132 map->name, base, start); ··· 141 141 cfi->numchips++; 142 142 143 143 /* Put it back into Read Mode */ 144 - qry_mode_off(base, map, cfi); 144 + cfi_qry_mode_off(base, map, cfi); 145 145 xip_allowed(base, map); 146 146 147 147 printk(KERN_INFO "%s: Found %d x%d devices at 0x%x in %d-bit bank\n", ··· 201 201 cfi_read_query(map, base + 0xf * ofs_factor); 202 202 203 203 /* Put it back into Read Mode */ 204 - qry_mode_off(base, map, cfi); 204 + cfi_qry_mode_off(base, map, cfi); 205 205 xip_allowed(base, map); 206 206 207 207 /* Do any necessary byteswapping */
+15 -11
drivers/mtd/chips/cfi_util.c
··· 24 24 #include <linux/mtd/cfi.h> 25 25 #include <linux/mtd/compatmac.h> 26 26 27 - int __xipram qry_present(struct map_info *map, __u32 base, 28 - struct cfi_private *cfi) 27 + int __xipram cfi_qry_present(struct map_info *map, __u32 base, 28 + struct cfi_private *cfi) 29 29 { 30 30 int osf = cfi->interleave * cfi->device_type; /* scale factor */ 31 31 map_word val[3]; ··· 50 50 51 51 return 1; /* "QRY" found */ 52 52 } 53 + EXPORT_SYMBOL_GPL(cfi_qry_present); 53 54 54 - int __xipram qry_mode_on(uint32_t base, struct map_info *map, 55 - struct cfi_private *cfi) 55 + int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, 56 + struct cfi_private *cfi) 56 57 { 57 58 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 58 59 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); 59 - if (qry_present(map, base, cfi)) 60 + if (cfi_qry_present(map, base, cfi)) 60 61 return 1; 61 62 /* QRY not found probably we deal with some odd CFI chips */ 62 63 /* Some revisions of some old Intel chips? */ 63 64 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 64 65 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); 65 66 cfi_send_gen_cmd(0x98, 0x55, base, map, cfi, cfi->device_type, NULL); 66 - if (qry_present(map, base, cfi)) 67 + if (cfi_qry_present(map, base, cfi)) 67 68 return 1; 68 69 /* ST M29DW chips */ 69 70 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 70 71 cfi_send_gen_cmd(0x98, 0x555, base, map, cfi, cfi->device_type, NULL); 71 - if (qry_present(map, base, cfi)) 72 + if (cfi_qry_present(map, base, cfi)) 72 73 return 1; 73 74 /* QRY not found */ 74 75 return 0; 75 76 } 76 - void __xipram qry_mode_off(uint32_t base, struct map_info *map, 77 - struct cfi_private *cfi) 77 + EXPORT_SYMBOL_GPL(cfi_qry_mode_on); 78 + 79 + void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map, 80 + struct cfi_private *cfi) 78 81 { 79 82 cfi_send_gen_cmd(0xF0, 0, base, map, cfi, cfi->device_type, NULL); 80 83 cfi_send_gen_cmd(0xFF, 0, base, map, cfi, cfi->device_type, NULL); 81 84 } 85 + EXPORT_SYMBOL_GPL(cfi_qry_mode_off); 82 86 83 87 struct cfi_extquery * 84 88 __xipram cfi_read_pri(struct map_info *map, __u16 adr, __u16 size, const char* name) ··· 108 104 #endif 109 105 110 106 /* Switch it into Query Mode */ 111 - qry_mode_on(base, map, cfi); 107 + cfi_qry_mode_on(base, map, cfi); 112 108 /* Read in the Extended Query Table */ 113 109 for (i=0; i<size; i++) { 114 110 ((unsigned char *)extp)[i] = ··· 116 112 } 117 113 118 114 /* Make sure it returns to read mode */ 119 - qry_mode_off(base, map, cfi); 115 + cfi_qry_mode_off(base, map, cfi); 120 116 121 117 #ifdef CONFIG_MTD_XIP 122 118 (void) map_read(map, base);
+6 -6
include/linux/mtd/cfi.h
··· 483 483 } 484 484 } 485 485 486 - int __xipram qry_present(struct map_info *map, __u32 base, 487 - struct cfi_private *cfi); 488 - int __xipram qry_mode_on(uint32_t base, struct map_info *map, 489 - struct cfi_private *cfi); 490 - void __xipram qry_mode_off(uint32_t base, struct map_info *map, 491 - struct cfi_private *cfi); 486 + int __xipram cfi_qry_present(struct map_info *map, __u32 base, 487 + struct cfi_private *cfi); 488 + int __xipram cfi_qry_mode_on(uint32_t base, struct map_info *map, 489 + struct cfi_private *cfi); 490 + void __xipram cfi_qry_mode_off(uint32_t base, struct map_info *map, 491 + struct cfi_private *cfi); 492 492 493 493 struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size, 494 494 const char* name);