mtd: atmel_nand: Use of_device_get_match_data
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Mar 24 11:59:03 PDT 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8ce06d379a06b4d5c9f944bb60e80b084d16bfc0
Commit: 8ce06d379a06b4d5c9f944bb60e80b084d16bfc0
Parent: e88b7f7d6ca47531af602cfb6abdb31ea13eabc3
Author: Romain Izard <romain.izard.pro at gmail.com>
AuthorDate: Fri Jan 15 11:34:57 2016 +0100
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Sat Jan 23 15:03:48 2016 -0800
mtd: atmel_nand: Use of_device_get_match_data
Remove the need for forward declaration and the risk for a null pointer
when accessing the private part of the compatible match table, by using
the newly introduced of_device_get_match_data function.
Signed-off-by: Romain Izard <romain.izard.pro at gmail.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/nand/atmel_nand.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index ad9f4b0..affe7a7 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1486,8 +1486,6 @@ static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
ecc_writel(host->ecc, CR, ATMEL_ECC_RST);
}
-static const struct of_device_id atmel_nand_dt_ids[];
-
static int atmel_of_init_port(struct atmel_nand_host *host,
struct device_node *np)
{
@@ -1498,7 +1496,7 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
enum of_gpio_flags flags = 0;
host->caps = (struct atmel_nand_caps *)
- of_match_device(atmel_nand_dt_ids, host->dev)->data;
+ of_device_get_match_data(host->dev);
if (of_property_read_u32(np, "atmel,nand-addr-offset", &val) == 0) {
if (val >= 32) {
More information about the linux-mtd-cvs
mailing list