diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2014-09-29 05:47:54 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-10-17 12:29:21 -0400 |
commit | 70f3ce0510afdad7cbaf27ab7ab961377205c782 (patch) | |
tree | 29df1a4e2259f90e0d2a1d35a7c8484688dc6253 /include/linux/mtd | |
parent | 90e55b3812a1245bb674afcc4410ddba7db402f6 (diff) |
mtd: spi-nor: make spi_nor_scan() take a chip type name, not spi_device_id
Drivers currently call spi_nor_match_id() and then spi_nor_scan().
This adds a dependency on struct spi_device_id which we want to
avoid. Make spi_nor_scan() do it for them.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/spi-nor.h | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 9e6294f32ba8..a5a7a086748d 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h | |||
@@ -187,32 +187,18 @@ struct spi_nor { | |||
187 | /** | 187 | /** |
188 | * spi_nor_scan() - scan the SPI NOR | 188 | * spi_nor_scan() - scan the SPI NOR |
189 | * @nor: the spi_nor structure | 189 | * @nor: the spi_nor structure |
190 | * @id: the spi_device_id provided by the driver | 190 | * @name: the chip type name |
191 | * @mode: the read mode supported by the driver | 191 | * @mode: the read mode supported by the driver |
192 | * | 192 | * |
193 | * The drivers can use this fuction to scan the SPI NOR. | 193 | * The drivers can use this fuction to scan the SPI NOR. |
194 | * In the scanning, it will try to get all the necessary information to | 194 | * In the scanning, it will try to get all the necessary information to |
195 | * fill the mtd_info{} and the spi_nor{}. | 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 | 197 | * The chip type name can be provided through the @name parameter. |
198 | * the spi_device_id detected by the scanning. | ||
199 | * | 198 | * |
200 | * Return: 0 for success, others for failure. | 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, | 201 | int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode); |
203 | enum read_mode mode); | ||
204 | extern const struct spi_device_id spi_nor_ids[]; | 202 | extern const struct spi_device_id spi_nor_ids[]; |
205 | 203 | ||
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); | ||
217 | |||
218 | #endif | 204 | #endif |