X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/d9b73ec6744d03a52142bc36837750e8bb33b744..d2b8246b44ea4956f89668794d05f6b040d1f081:/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c diff --git a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c index 664f7dfcc..1cb8f8240 100644 --- a/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c +++ b/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c @@ -12,6 +12,8 @@ * by the Free Software Foundation. */ +#include +#include #include #include #include @@ -22,8 +24,8 @@ #include #include -#include -#include +#include +#include #define DRV_NAME "rb4xx-nand" #define DRV_VERSION "0.2.0" @@ -134,7 +136,7 @@ static void rb4xx_nand_read_buf(struct mtd_info *mtd, unsigned char *buf, pr_err("rb4xx_nand: read buf failed, err=%d\n", err); } -static int __init rb4xx_nand_probe(struct platform_device *pdev) +static int __devinit rb4xx_nand_probe(struct platform_device *pdev) { struct rb4xx_nand_info *info; int ret; @@ -238,12 +240,8 @@ static int __init rb4xx_nand_probe(struct platform_device *pdev) goto err_set_drvdata; } -#ifdef CONFIG_MTD_PARTITIONS - ret = add_mtd_partitions(&info->mtd, rb4xx_nand_partitions, + mtd_device_register(&info->mtd, rb4xx_nand_partitions, ARRAY_SIZE(rb4xx_nand_partitions)); -#else - ret = add_mtd_device(&info->mtd); -#endif if (ret) goto err_release_nand;