From ac389b07493daa9db00749a415e679abcb1eb59a Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 29 Nov 2017 15:01:22 +0900 Subject: [PATCH 1/7] ARM: uniphier: clean up board_init Remove unnecessary DECLARE_GLOBAL_DATA_PTR and header includes. has been replaced with and . Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/board_init.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-uniphier/board_init.c b/arch/arm/mach-uniphier/board_init.c index 121b78605f..8418902a5a 100644 --- a/arch/arm/mach-uniphier/board_init.c +++ b/arch/arm/mach-uniphier/board_init.c @@ -6,17 +6,14 @@ * SPDX-License-Identifier: GPL-2.0+ */ -#include -#include +#include #include +#include #include "init.h" #include "micro-support-card.h" -#include "sg-regs.h" #include "soc-info.h" -DECLARE_GLOBAL_DATA_PTR; - #ifdef CONFIG_ARCH_UNIPHIER_LD20 static void uniphier_ld20_misc_init(void) { From 1a7e176d27eb54cf75b2c54dfe1a351cc434d1d5 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 29 Nov 2017 19:18:18 +0900 Subject: [PATCH 2/7] mtd: nand: denali: remove bogus __maybe_unused denali_setup_data_interface() is always used. I put __maybe_unused for a temporal use, then forgot to delete it. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index b116d3a17c..7a87adc378 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -938,7 +938,7 @@ static int denali_erase(struct mtd_info *mtd, int page) return irq_status & INTR__ERASE_COMP ? 0 : NAND_STATUS_FAIL; } -static int __maybe_unused denali_setup_data_interface(struct mtd_info *mtd, int chipnr, +static int denali_setup_data_interface(struct mtd_info *mtd, int chipnr, const struct nand_data_interface *conf) { struct denali_nand_info *denali = mtd_to_denali(mtd); From 57f9bb9404e0578b4701ff900fdfa884d84c74b0 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Wed, 29 Nov 2017 19:19:09 +0900 Subject: [PATCH 3/7] mtd: nand: denali: remove ad-hoc board_nand_init() entry This driver is highly dependent on the configuration from denali_dt.c Please enable CONFIG_NAND_DENALI_DT if you use this driver. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 7a87adc378..8ff2d09422 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1366,29 +1366,3 @@ free_buf: return ret; } - -#ifndef CONFIG_NAND_DENALI_DT -static int __board_nand_init(void) -{ - struct denali_nand_info *denali; - - denali = kzalloc(sizeof(*denali), GFP_KERNEL); - if (!denali) - return -ENOMEM; - - /* - * In the future, these base addresses should be taken from - * Device Tree or platform data. - */ - denali->reg = (void __iomem *)CONFIG_SYS_NAND_REGS_BASE; - denali->host = (void __iomem *)CONFIG_SYS_NAND_DATA_BASE; - - return denali_init(denali); -} - -void board_nand_init(void) -{ - if (__board_nand_init() < 0) - pr_warn("Failed to initialize Denali NAND controller.\n"); -} -#endif From 6ae3900a86b52429bf7a73ad832f0ad02acc2282 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 30 Nov 2017 13:45:24 +0900 Subject: [PATCH 4/7] mtd: nand: Rename nand.h into rawnand.h This header was renamed to rawnand.h in Linux. The following is the corresponding commit in Linux. commit d4092d76a4a4e57b65910899948a83cc8646c5a5 Author: Boris Brezillon Date: Fri Aug 4 17:29:10 2017 +0200 mtd: nand: Rename nand.h into rawnand.h We are planning to share more code between different NAND based devices (SPI NAND, OneNAND and raw NANDs), but before doing that we need to move the existing include/linux/mtd/nand.h file into include/linux/mtd/rawnand.h so we can later create a nand.h header containing all common structure and function prototypes. Signed-off-by: Masahiro Yamada --- arch/arm/include/asm/ti-common/davinci_nand.h | 2 +- arch/arm/mach-omap2/omap3/spl_id_nand.c | 2 +- board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c | 2 +- board/isee/igep00x0/common.c | 2 +- board/isee/igep00x0/igep00x0.c | 2 +- board/isee/igep00x0/spl.c | 2 +- board/logicpd/omap3som/omap3logic.c | 2 +- board/mini-box/picosam9g45/picosam9g45.c | 2 +- board/overo/overo.c | 2 +- board/siemens/taurus/taurus.c | 2 +- board/ti/beagle/beagle.c | 2 +- board/ti/evm/evm.c | 2 +- cmd/jffs2.c | 2 +- cmd/mtdparts.c | 2 +- drivers/mtd/nand/arasan_nfc.c | 2 +- drivers/mtd/nand/denali.h | 2 +- drivers/mtd/nand/denali_spl.c | 2 +- drivers/mtd/nand/fsl_elbc_nand.c | 2 +- drivers/mtd/nand/fsl_ifc_nand.c | 2 +- drivers/mtd/nand/fsl_ifc_spl.c | 2 +- drivers/mtd/nand/mxs_nand.c | 2 +- drivers/mtd/nand/nand_base.c | 2 +- drivers/mtd/nand/nand_bbt.c | 2 +- drivers/mtd/nand/nand_bch.c | 2 +- drivers/mtd/nand/nand_ids.c | 2 +- drivers/mtd/nand/nand_timings.c | 2 +- drivers/mtd/nand/pxa3xx_nand.c | 2 +- drivers/mtd/nand/sunxi_nand.c | 2 +- drivers/mtd/nand/vf610_nfc.c | 2 +- drivers/mtd/nand/zynq_nand.c | 2 +- fs/yaffs2/yaffs_mtdif.c | 2 +- include/linux/mtd/fsl_upm.h | 2 +- include/linux/mtd/fsmc_nand.h | 2 +- include/linux/mtd/{nand.h => rawnand.h} | 9 +++------ include/nand.h | 2 +- 35 files changed, 37 insertions(+), 40 deletions(-) rename include/linux/mtd/{nand.h => rawnand.h} (99%) diff --git a/arch/arm/include/asm/ti-common/davinci_nand.h b/arch/arm/include/asm/ti-common/davinci_nand.h index f343ac2c0f..e26381c7fd 100644 --- a/arch/arm/include/asm/ti-common/davinci_nand.h +++ b/arch/arm/include/asm/ti-common/davinci_nand.h @@ -9,7 +9,7 @@ #ifndef _DAVINCI_NAND_H_ #define _DAVINCI_NAND_H_ -#include +#include #include #define NAND_READ_START 0x00 diff --git a/arch/arm/mach-omap2/omap3/spl_id_nand.c b/arch/arm/mach-omap2/omap3/spl_id_nand.c index 0e2f0a2f6d..5c9549c743 100644 --- a/arch/arm/mach-omap2/omap3/spl_id_nand.c +++ b/arch/arm/mach-omap2/omap3/spl_id_nand.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include diff --git a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c index 98430c4246..78ddbbbad1 100644 --- a/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c +++ b/board/atmel/at91sam9m10g45ek/at91sam9m10g45ek.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include diff --git a/board/isee/igep00x0/common.c b/board/isee/igep00x0/common.c index e59516f612..d35afa5cad 100644 --- a/board/isee/igep00x0/common.c +++ b/board/isee/igep00x0/common.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "igep00x0.h" DECLARE_GLOBAL_DATA_PTR; diff --git a/board/isee/igep00x0/igep00x0.c b/board/isee/igep00x0/igep00x0.c index 5c7f256711..01bb99fbb8 100644 --- a/board/isee/igep00x0/igep00x0.c +++ b/board/isee/igep00x0/igep00x0.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/board/isee/igep00x0/spl.c b/board/isee/igep00x0/spl.c index eb705cbe88..f1c99dd7cf 100644 --- a/board/isee/igep00x0/spl.c +++ b/board/isee/igep00x0/spl.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include "igep00x0.h" /* diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c index 1da9e383c2..a55a520e63 100644 --- a/board/logicpd/omap3som/omap3logic.c +++ b/board/logicpd/omap3som/omap3logic.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/board/mini-box/picosam9g45/picosam9g45.c b/board/mini-box/picosam9g45/picosam9g45.c index f3263eba6e..dd2db9a762 100644 --- a/board/mini-box/picosam9g45/picosam9g45.c +++ b/board/mini-box/picosam9g45/picosam9g45.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB) diff --git a/board/overo/overo.c b/board/overo/overo.c index 140e34d4dd..7b44a37103 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 8390bdd5f8..71541ba3a4 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index 2f62fbec69..bdf84b0be8 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -20,7 +20,7 @@ #include #endif #include -#include +#include #include #include #include diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 1f0433dcc0..4d5ddff1e1 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cmd/jffs2.c b/cmd/jffs2.c index aee2f4513d..13c533cf12 100644 --- a/cmd/jffs2.c +++ b/cmd/jffs2.c @@ -80,7 +80,7 @@ #include #if defined(CONFIG_CMD_NAND) -#include +#include #include #endif diff --git a/cmd/mtdparts.c b/cmd/mtdparts.c index 3275eb919b..3169c33265 100644 --- a/cmd/mtdparts.c +++ b/cmd/mtdparts.c @@ -81,7 +81,7 @@ #include #if defined(CONFIG_CMD_NAND) -#include +#include #include #endif diff --git a/drivers/mtd/nand/arasan_nfc.c b/drivers/mtd/nand/arasan_nfc.c index a8f795d957..14b27337b6 100644 --- a/drivers/mtd/nand/arasan_nfc.c +++ b/drivers/mtd/nand/arasan_nfc.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h index 04b4ae2683..bdaea71f91 100644 --- a/drivers/mtd/nand/denali.h +++ b/drivers/mtd/nand/denali.h @@ -9,7 +9,7 @@ #define __DENALI_H__ #include -#include +#include #include #define DEVICE_RESET 0x0 diff --git a/drivers/mtd/nand/denali_spl.c b/drivers/mtd/nand/denali_spl.c index 3cb9849735..1a59b937a6 100644 --- a/drivers/mtd/nand/denali_spl.c +++ b/drivers/mtd/nand/denali_spl.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include "denali.h" #define DENALI_MAP01 (1 << 26) /* read/write pages in PIO */ diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c index b3c23b0339..fc3720b3bd 100644 --- a/drivers/mtd/nand/fsl_elbc_nand.c +++ b/drivers/mtd/nand/fsl_elbc_nand.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c index a757a3be44..d1165f7d6b 100644 --- a/drivers/mtd/nand/fsl_ifc_nand.c +++ b/drivers/mtd/nand/fsl_ifc_nand.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c index 4e49a4e154..59461945d3 100644 --- a/drivers/mtd/nand/fsl_ifc_spl.c +++ b/drivers/mtd/nand/fsl_ifc_spl.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #ifdef CONFIG_CHAIN_OF_TRUST #include #endif diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c index d774ab8d82..bed9b65ef4 100644 --- a/drivers/mtd/nand/mxs_nand.c +++ b/drivers/mtd/nand/mxs_nand.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index aca32318d5..eb9f121f81 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #ifdef CONFIG_MTD_PARTITIONS diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c index 74c4c9a3c8..ba785c5d53 100644 --- a/drivers/mtd/nand/nand_bbt.c +++ b/drivers/mtd/nand/nand_bbt.c @@ -62,7 +62,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/nand_bch.c b/drivers/mtd/nand/nand_bch.c index 6c20d53e7e..b7c1171d50 100644 --- a/drivers/mtd/nand/nand_bch.c +++ b/drivers/mtd/nand/nand_bch.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c index d36f9006c9..4009d64123 100644 --- a/drivers/mtd/nand/nand_ids.c +++ b/drivers/mtd/nand/nand_ids.c @@ -7,7 +7,7 @@ * */ #include -#include +#include #include #define LP_OPTIONS NAND_SAMSUNG_LP_OPTIONS diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c index 9935557291..c0545a4fb1 100644 --- a/drivers/mtd/nand/nand_timings.c +++ b/drivers/mtd/nand/nand_timings.c @@ -10,7 +10,7 @@ */ #include #include -#include +#include static const struct nand_data_interface onfi_sdr_timings[] = { /* Mode 0 */ diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index cedbb239b6..a3ca3373e4 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "pxa3xx_nand.h" diff --git a/drivers/mtd/nand/sunxi_nand.c b/drivers/mtd/nand/sunxi_nand.c index 8bc3828854..532e03cd84 100644 --- a/drivers/mtd/nand/sunxi_nand.c +++ b/drivers/mtd/nand/sunxi_nand.c @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/vf610_nfc.c b/drivers/mtd/nand/vf610_nfc.c index f99bdaf94d..dd53f2bedb 100644 --- a/drivers/mtd/nand/vf610_nfc.c +++ b/drivers/mtd/nand/vf610_nfc.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c index 076b878244..6494196049 100644 --- a/drivers/mtd/nand/zynq_nand.c +++ b/drivers/mtd/nand/zynq_nand.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/fs/yaffs2/yaffs_mtdif.c b/fs/yaffs2/yaffs_mtdif.c index 636c7770e2..d338f9aa91 100644 --- a/fs/yaffs2/yaffs_mtdif.c +++ b/fs/yaffs2/yaffs_mtdif.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include static inline void translate_spare2oob(const struct yaffs_spare *spare, u8 *oob) diff --git a/include/linux/mtd/fsl_upm.h b/include/linux/mtd/fsl_upm.h index 0a949bca0d..a023860e7b 100644 --- a/include/linux/mtd/fsl_upm.h +++ b/include/linux/mtd/fsl_upm.h @@ -10,7 +10,7 @@ #ifndef __LINUX_MTD_NAND_FSL_UPM #define __LINUX_MTD_NAND_FSL_UPM -#include +#include #define FSL_UPM_WAIT_RUN_PATTERN 0x1 #define FSL_UPM_WAIT_WRITE_BYTE 0x2 diff --git a/include/linux/mtd/fsmc_nand.h b/include/linux/mtd/fsmc_nand.h index f0f77270af..bc3db030d0 100644 --- a/include/linux/mtd/fsmc_nand.h +++ b/include/linux/mtd/fsmc_nand.h @@ -8,7 +8,7 @@ #ifndef __FSMC_NAND_H__ #define __FSMC_NAND_H__ -#include +#include struct fsmc_regs { u32 ctrl; /* 0x00 */ diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/rawnand.h similarity index 99% rename from include/linux/mtd/nand.h rename to include/linux/mtd/rawnand.h index d1db34c334..192709b6e4 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/rawnand.h @@ -1,6 +1,4 @@ /* - * linux/include/linux/mtd/nand.h - * * Copyright © 2000-2010 David Woodhouse * Steven J. Hill * Thomas Gleixner @@ -13,8 +11,8 @@ * Changelog: * See git changelog. */ -#ifndef __LINUX_MTD_NAND_H -#define __LINUX_MTD_NAND_H +#ifndef __LINUX_MTD_RAWNAND_H +#define __LINUX_MTD_RAWNAND_H #include @@ -1270,5 +1268,4 @@ int nand_maximize_ecc(struct nand_chip *chip, /* Reset and initialize a NAND device */ int nand_reset(struct nand_chip *chip, int chipnr); - -#endif /* __LINUX_MTD_NAND_H */ +#endif /* __LINUX_MTD_RAWNAND_H */ diff --git a/include/nand.h b/include/nand.h index c1c1d8cce6..cead563553 100644 --- a/include/nand.h +++ b/include/nand.h @@ -32,7 +32,7 @@ unsigned long nand_size(void); #include #include -#include +#include int nand_mtd_to_devnum(struct mtd_info *mtd); From ba8c9ea38a5e5f31edc3ef7e3490f0e2143a8360 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 30 Nov 2017 13:45:25 +0900 Subject: [PATCH 5/7] mtd: nand: include from include/linux/mtd/rawnand.h This is needed for ARCH_DMA_MINALIGN. Signed-off-by: Masahiro Yamada --- include/linux/mtd/rawnand.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 192709b6e4..6c3e838d80 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -20,6 +20,7 @@ #include #include #include +#include struct mtd_info; struct nand_flash_dev; From 681ed4d0d5096b16f81c54c3e5a5efdc9f5f0bc1 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 30 Nov 2017 13:45:26 +0900 Subject: [PATCH 6/7] mtd: nand: denali_dt: replace printf() with pr_err() The Linux derived log functions can be used anywhere and easily turned on/off by CONFIG_LOGLEVEL. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali_dt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 9d6cb09b42..c96512f2df 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -5,11 +5,11 @@ * SPDX-License-Identifier: GPL-2.0+ */ -#include #include #include #include #include +#include #include "denali.h" @@ -118,6 +118,6 @@ void board_nand_init(void) DM_GET_DRIVER(denali_nand_dt), &dev); if (ret && ret != -ENODEV) - printf("Failed to initialize Denali NAND controller. (error %d)\n", + pr_err("Failed to initialize Denali NAND controller. (error %d)\n", ret); } From 0faef2eba946a95f9c78d2b3db47e15bac04b52e Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 30 Nov 2017 13:45:27 +0900 Subject: [PATCH 7/7] mtd: nand: denali: consolidate include directives Include necessary headers explicitly without relying on indirect header inclusion. , are unneeded. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 8ff2d09422..3a67653cb9 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -6,14 +6,14 @@ * SPDX-License-Identifier: GPL-2.0+ */ -#include -#include -#include #include +#include #include #include #include #include +#include +#include #include "denali.h"