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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus-20141102' of git://git.infradead.org/linux-mtd

Pull MTD fixes from Brian Norris:
"Three main MTD fixes for 3.18:

- A regression from 3.16 which was noticed in 3.17. With the
restructuring of the m25p80.c driver and the SPI NOR library
framework, we omitted proper listing of the SPI device IDs. This
means m25p80.c wouldn't auto-load (modprobe) properly when built as
a module. For now, we duplicate the device IDs into both modules.

- The OMAP / ELM modules were depending on an implicit link ordering.
Use deferred probing so that the new link order (in 3.18-rc) can
still allow for successful probing.

- Fix suspend/resume support for LH28F640BF NOR flash"

* tag 'for-linus-20141102' of git://git.infradead.org/linux-mtd:
mtd: cfi_cmdset_0001.c: fix resume for LH28F640BF chips
mtd: omap: fix mtd devices not showing up
mtd: m25p80,spi-nor: Fix module aliases for m25p80
mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id
mtd: m25p80: get rid of spi_get_device_id

+73 -39
+2
drivers/mtd/chips/cfi_cmdset_0001.c
··· 2590 2590 2591 2591 /* Go to known state. Chip may have been power cycled */ 2592 2592 if (chip->state == FL_PM_SUSPENDED) { 2593 + /* Refresh LH28F640BF Partition Config. Register */ 2594 + fixup_LH28F640BF(mtd); 2593 2595 map_write(map, CMD(0xFF), cfi->chips[i].start); 2594 2596 chip->oldstate = chip->state = FL_READY; 2595 2597 wake_up(&chip->wq);
+56 -8
drivers/mtd/devices/m25p80.c
··· 193 193 { 194 194 struct mtd_part_parser_data ppdata; 195 195 struct flash_platform_data *data; 196 - const struct spi_device_id *id = NULL; 197 196 struct m25p *flash; 198 197 struct spi_nor *nor; 199 198 enum read_mode mode = SPI_NOR_NORMAL; 199 + char *flash_name = NULL; 200 200 int ret; 201 201 202 202 data = dev_get_platdata(&spi->dev); ··· 236 236 * If that's the case, respect "type" and ignore a "name". 237 237 */ 238 238 if (data && data->type) 239 - id = spi_nor_match_id(data->type); 239 + flash_name = data->type; 240 + else 241 + flash_name = spi->modalias; 240 242 241 - /* If we didn't get name from platform, simply use "modalias". */ 242 - if (!id) 243 - id = spi_get_device_id(spi); 244 - 245 - ret = spi_nor_scan(nor, id, mode); 243 + ret = spi_nor_scan(nor, flash_name, mode); 246 244 if (ret) 247 245 return ret; 248 246 ··· 261 263 } 262 264 263 265 266 + /* 267 + * XXX This needs to be kept in sync with spi_nor_ids. We can't share 268 + * it with spi-nor, because if this is built as a module then modpost 269 + * won't be able to read it and add appropriate aliases. 270 + */ 271 + static const struct spi_device_id m25p_ids[] = { 272 + {"at25fs010"}, {"at25fs040"}, {"at25df041a"}, {"at25df321a"}, 273 + {"at25df641"}, {"at26f004"}, {"at26df081a"}, {"at26df161a"}, 274 + {"at26df321"}, {"at45db081d"}, 275 + {"en25f32"}, {"en25p32"}, {"en25q32b"}, {"en25p64"}, 276 + {"en25q64"}, {"en25qh128"}, {"en25qh256"}, 277 + {"f25l32pa"}, 278 + {"mr25h256"}, {"mr25h10"}, 279 + {"gd25q32"}, {"gd25q64"}, 280 + {"160s33b"}, {"320s33b"}, {"640s33b"}, 281 + {"mx25l2005a"}, {"mx25l4005a"}, {"mx25l8005"}, {"mx25l1606e"}, 282 + {"mx25l3205d"}, {"mx25l3255e"}, {"mx25l6405d"}, {"mx25l12805d"}, 283 + {"mx25l12855e"},{"mx25l25635e"},{"mx25l25655e"},{"mx66l51235l"}, 284 + {"mx66l1g55g"}, 285 + {"n25q064"}, {"n25q128a11"}, {"n25q128a13"}, {"n25q256a"}, 286 + {"n25q512a"}, {"n25q512ax3"}, {"n25q00"}, 287 + {"pm25lv512"}, {"pm25lv010"}, {"pm25lq032"}, 288 + {"s25sl032p"}, {"s25sl064p"}, {"s25fl256s0"}, {"s25fl256s1"}, 289 + {"s25fl512s"}, {"s70fl01gs"}, {"s25sl12800"}, {"s25sl12801"}, 290 + {"s25fl129p0"}, {"s25fl129p1"}, {"s25sl004a"}, {"s25sl008a"}, 291 + {"s25sl016a"}, {"s25sl032a"}, {"s25sl064a"}, {"s25fl008k"}, 292 + {"s25fl016k"}, {"s25fl064k"}, 293 + {"sst25vf040b"},{"sst25vf080b"},{"sst25vf016b"},{"sst25vf032b"}, 294 + {"sst25vf064c"},{"sst25wf512"}, {"sst25wf010"}, {"sst25wf020"}, 295 + {"sst25wf040"}, 296 + {"m25p05"}, {"m25p10"}, {"m25p20"}, {"m25p40"}, 297 + {"m25p80"}, {"m25p16"}, {"m25p32"}, {"m25p64"}, 298 + {"m25p128"}, {"n25q032"}, 299 + {"m25p05-nonjedec"}, {"m25p10-nonjedec"}, {"m25p20-nonjedec"}, 300 + {"m25p40-nonjedec"}, {"m25p80-nonjedec"}, {"m25p16-nonjedec"}, 301 + {"m25p32-nonjedec"}, {"m25p64-nonjedec"}, {"m25p128-nonjedec"}, 302 + {"m45pe10"}, {"m45pe80"}, {"m45pe16"}, 303 + {"m25pe20"}, {"m25pe80"}, {"m25pe16"}, 304 + {"m25px16"}, {"m25px32"}, {"m25px32-s0"}, {"m25px32-s1"}, 305 + {"m25px64"}, 306 + {"w25x10"}, {"w25x20"}, {"w25x40"}, {"w25x80"}, 307 + {"w25x16"}, {"w25x32"}, {"w25q32"}, {"w25q32dw"}, 308 + {"w25x64"}, {"w25q64"}, {"w25q128"}, {"w25q80"}, 309 + {"w25q80bl"}, {"w25q128"}, {"w25q256"}, {"cat25c11"}, 310 + {"cat25c03"}, {"cat25c09"}, {"cat25c17"}, {"cat25128"}, 311 + { }, 312 + }; 313 + MODULE_DEVICE_TABLE(spi, m25p_ids); 314 + 315 + 264 316 static struct spi_driver m25p80_driver = { 265 317 .driver = { 266 318 .name = "m25p80", 267 319 .owner = THIS_MODULE, 268 320 }, 269 - .id_table = spi_nor_ids, 321 + .id_table = m25p_ids, 270 322 .probe = m25p_probe, 271 323 .remove = m25p_remove, 272 324
+1 -1
drivers/mtd/nand/omap_elm.c
··· 115 115 116 116 if (!info) { 117 117 dev_err(dev, "Unable to configure elm - device not probed?\n"); 118 - return -ENODEV; 118 + return -EPROBE_DEFER; 119 119 } 120 120 /* ELM cannot detect ECC errors for chunks > 1KB */ 121 121 if (ecc_step_size > ((ELM_ECC_SIZE + 1) / 2)) {
+1 -6
drivers/mtd/spi-nor/fsl-quadspi.c
··· 881 881 882 882 /* iterate the subnodes. */ 883 883 for_each_available_child_of_node(dev->of_node, np) { 884 - const struct spi_device_id *id; 885 884 char modalias[40]; 886 885 887 886 /* skip the holes */ ··· 908 909 if (of_modalias_node(np, modalias, sizeof(modalias)) < 0) 909 910 goto map_failed; 910 911 911 - id = spi_nor_match_id(modalias); 912 - if (!id) 913 - goto map_failed; 914 - 915 912 ret = of_property_read_u32(np, "spi-max-frequency", 916 913 &q->clk_rate); 917 914 if (ret < 0) ··· 916 921 /* set the chip address for READID */ 917 922 fsl_qspi_set_base_addr(q, nor); 918 923 919 - ret = spi_nor_scan(nor, id, SPI_NOR_QUAD); 924 + ret = spi_nor_scan(nor, modalias, SPI_NOR_QUAD); 920 925 if (ret) 921 926 goto map_failed; 922 927
+10 -6
drivers/mtd/spi-nor/spi-nor.c
··· 28 28 29 29 #define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16) 30 30 31 + static const struct spi_device_id *spi_nor_match_id(const char *name); 32 + 31 33 /* 32 34 * Read the status register, returning its value in the location 33 35 * Return the status register value. ··· 475 473 * more nor chips. This current list focusses on newer chips, which 476 474 * have been converging on command sets which including JEDEC ID. 477 475 */ 478 - const struct spi_device_id spi_nor_ids[] = { 476 + static const struct spi_device_id spi_nor_ids[] = { 479 477 /* Atmel -- some are (confusingly) marketed as "DataFlash" */ 480 478 { "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4, SECT_4K) }, 481 479 { "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8, SECT_4K) }, ··· 639 637 { "cat25128", CAT25_INFO(2048, 8, 64, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, 640 638 { }, 641 639 }; 642 - EXPORT_SYMBOL_GPL(spi_nor_ids); 643 640 644 641 static const struct spi_device_id *spi_nor_read_id(struct spi_nor *nor) 645 642 { ··· 912 911 return 0; 913 912 } 914 913 915 - int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id, 916 - enum read_mode mode) 914 + int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) 917 915 { 916 + const struct spi_device_id *id = NULL; 918 917 struct flash_info *info; 919 918 struct device *dev = nor->dev; 920 919 struct mtd_info *mtd = nor->mtd; ··· 925 924 ret = spi_nor_check(nor); 926 925 if (ret) 927 926 return ret; 927 + 928 + id = spi_nor_match_id(name); 929 + if (!id) 930 + return -ENOENT; 928 931 929 932 info = (void *)id->driver_data; 930 933 ··· 1118 1113 } 1119 1114 EXPORT_SYMBOL_GPL(spi_nor_scan); 1120 1115 1121 - const struct spi_device_id *spi_nor_match_id(char *name) 1116 + static const struct spi_device_id *spi_nor_match_id(const char *name) 1122 1117 { 1123 1118 const struct spi_device_id *id = spi_nor_ids; 1124 1119 ··· 1129 1124 } 1130 1125 return NULL; 1131 1126 } 1132 - EXPORT_SYMBOL_GPL(spi_nor_match_id); 1133 1127 1134 1128 MODULE_LICENSE("GPL"); 1135 1129 MODULE_AUTHOR("Huang Shijie <shijie8@gmail.com>");
+3 -18
include/linux/mtd/spi-nor.h
··· 187 187 /** 188 188 * spi_nor_scan() - scan the SPI NOR 189 189 * @nor: the spi_nor structure 190 - * @id: the spi_device_id provided by the driver 190 + * @name: the chip type name 191 191 * @mode: the read mode supported by the driver 192 192 * 193 193 * The drivers can use this fuction to scan the SPI NOR. 194 194 * In the scanning, it will try to get all the necessary information to 195 195 * fill the mtd_info{} and the spi_nor{}. 196 196 * 197 - * The board may assigns a spi_device_id with @id which be used to compared with 198 - * the spi_device_id detected by the scanning. 197 + * The chip type name can be provided through the @name parameter. 199 198 * 200 199 * Return: 0 for success, others for failure. 201 200 */ 202 - int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id, 203 - enum read_mode mode); 204 - extern const struct spi_device_id spi_nor_ids[]; 205 - 206 - /** 207 - * spi_nor_match_id() - find the spi_device_id by the name 208 - * @name: the name of the spi_device_id 209 - * 210 - * The drivers use this function to find the spi_device_id 211 - * specified by the @name. 212 - * 213 - * Return: returns the right spi_device_id pointer on success, 214 - * and returns NULL on failure. 215 - */ 216 - const struct spi_device_id *spi_nor_match_id(char *name); 201 + int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode); 217 202 218 203 #endif