forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
73 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ | |
|
||
#define JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16) | ||
|
||
static const struct spi_device_id *spi_nor_match_id(const char *name); | ||
|
||
/* | ||
* Read the status register, returning its value in the location | ||
* Return the status register value. | ||
|
@@ -473,7 +475,7 @@ struct flash_info { | |
* more nor chips. This current list focusses on newer chips, which | ||
* have been converging on command sets which including JEDEC ID. | ||
*/ | ||
const struct spi_device_id spi_nor_ids[] = { | ||
static const struct spi_device_id spi_nor_ids[] = { | ||
/* Atmel -- some are (confusingly) marketed as "DataFlash" */ | ||
{ "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4, SECT_4K) }, | ||
{ "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8, SECT_4K) }, | ||
|
@@ -637,7 +639,6 @@ const struct spi_device_id spi_nor_ids[] = { | |
{ "cat25128", CAT25_INFO(2048, 8, 64, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, | ||
{ }, | ||
}; | ||
EXPORT_SYMBOL_GPL(spi_nor_ids); | ||
|
||
static const struct spi_device_id *spi_nor_read_id(struct spi_nor *nor) | ||
{ | ||
|
@@ -911,9 +912,9 @@ static int spi_nor_check(struct spi_nor *nor) | |
return 0; | ||
} | ||
|
||
int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id, | ||
enum read_mode mode) | ||
int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) | ||
{ | ||
const struct spi_device_id *id = NULL; | ||
struct flash_info *info; | ||
struct device *dev = nor->dev; | ||
struct mtd_info *mtd = nor->mtd; | ||
|
@@ -925,6 +926,10 @@ int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id, | |
if (ret) | ||
return ret; | ||
|
||
id = spi_nor_match_id(name); | ||
if (!id) | ||
return -ENOENT; | ||
|
||
info = (void *)id->driver_data; | ||
|
||
if (info->jedec_id) { | ||
|
@@ -1113,7 +1118,7 @@ int spi_nor_scan(struct spi_nor *nor, const struct spi_device_id *id, | |
} | ||
EXPORT_SYMBOL_GPL(spi_nor_scan); | ||
|
||
const struct spi_device_id *spi_nor_match_id(char *name) | ||
static const struct spi_device_id *spi_nor_match_id(const char *name) | ||
{ | ||
const struct spi_device_id *id = spi_nor_ids; | ||
|
||
|
@@ -1124,7 +1129,6 @@ const struct spi_device_id *spi_nor_match_id(char *name) | |
} | ||
return NULL; | ||
} | ||
EXPORT_SYMBOL_GPL(spi_nor_match_id); | ||
|
||
MODULE_LICENSE("GPL"); | ||
MODULE_AUTHOR("Huang Shijie <[email protected]>"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters