To avoid name clashes unify all the function and static object names and
use one of the following prefixes which should be sufficiently unique:
- <vendor>_nor_
- <flash_family>_
- <flash_part>_
There are no functional changes.
Signed-off-by: Michael Walle <[email protected]>
---
drivers/mtd/spi-nor/winbond.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c
index 3d91888882e4..8314266c2fec 100644
--- a/drivers/mtd/spi-nor/winbond.c
+++ b/drivers/mtd/spi-nor/winbond.c
@@ -32,7 +32,7 @@ static const struct spi_nor_fixups w25q256_fixups = {
.post_bfpt = w25q256_post_bfpt_fixups,
};
-static const struct flash_info winbond_parts[] = {
+static const struct flash_info winbond_nor_parts[] = {
/* Winbond -- w25x "blocks" are 64K, "sectors" are 4KiB */
{ "w25x05", INFO(0xef3010, 0, 64 * 1024, 1)
NO_SFDP_FLAGS(SECT_4K) },
@@ -138,7 +138,7 @@ static const struct flash_info winbond_parts[] = {
*
* Return: 0 on success, -errno otherwise.
*/
-static int winbond_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
+static int winbond_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
{
int ret;
@@ -162,7 +162,7 @@ static int winbond_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
return spi_nor_write_disable(nor);
}
-static const struct spi_nor_otp_ops winbond_otp_ops = {
+static const struct spi_nor_otp_ops winbond_nor_otp_ops = {
.read = spi_nor_otp_read_secr,
.write = spi_nor_otp_write_secr,
.erase = spi_nor_otp_erase_secr,
@@ -170,25 +170,25 @@ static const struct spi_nor_otp_ops winbond_otp_ops = {
.is_locked = spi_nor_otp_is_locked_sr2,
};
-static void winbond_default_init(struct spi_nor *nor)
+static void winbond_nor_default_init(struct spi_nor *nor)
{
- nor->params->set_4byte_addr_mode = winbond_set_4byte_addr_mode;
+ nor->params->set_4byte_addr_mode = winbond_nor_set_4byte_addr_mode;
}
-static void winbond_late_init(struct spi_nor *nor)
+static void winbond_nor_late_init(struct spi_nor *nor)
{
if (nor->params->otp.org->n_regions)
- nor->params->otp.ops = &winbond_otp_ops;
+ nor->params->otp.ops = &winbond_nor_otp_ops;
}
-static const struct spi_nor_fixups winbond_fixups = {
- .default_init = winbond_default_init,
- .late_init = winbond_late_init,
+static const struct spi_nor_fixups winbond_nor_fixups = {
+ .default_init = winbond_nor_default_init,
+ .late_init = winbond_nor_late_init,
};
const struct spi_nor_manufacturer spi_nor_winbond = {
.name = "winbond",
- .parts = winbond_parts,
- .nparts = ARRAY_SIZE(winbond_parts),
- .fixups = &winbond_fixups,
+ .parts = winbond_nor_parts,
+ .nparts = ARRAY_SIZE(winbond_nor_parts),
+ .fixups = &winbond_nor_fixups,
};
--
2.30.2
Hi Michael,
I love your patch! Perhaps something to improve:
[auto build test WARNING on mtd/spi-nor/next]
[also build test WARNING on tip/master linux/master linus/master v5.17-rc4 next-20220217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Michael-Walle/mtd-spi-nor-move-vendor-specific-code-into-vendor-modules/20220220-192832
base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git spi-nor/next
config: alpha-randconfig-r034-20220220 (https://download.01.org/0day-ci/archive/20220221/[email protected]/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c09cbfe090ed6015773211aad1bd2387dd958b7a
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michael-Walle/mtd-spi-nor-move-vendor-specific-code-into-vendor-modules/20220220-192832
git checkout c09cbfe090ed6015773211aad1bd2387dd958b7a
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash drivers/mtd/spi-nor/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All warnings (new ones prefixed by >>):
>> drivers/mtd/spi-nor/winbond.c:141: warning: expecting prototype for winbond_set_4byte_addr_mode(). Prototype was for winbond_nor_set_4byte_addr_mode() instead
vim +141 drivers/mtd/spi-nor/winbond.c
7b8b22010af95f Boris Brezillon 2020-03-13 131
7b8b22010af95f Boris Brezillon 2020-03-13 132 /**
7b8b22010af95f Boris Brezillon 2020-03-13 133 * winbond_set_4byte_addr_mode() - Set 4-byte address mode for Winbond flashes.
7b8b22010af95f Boris Brezillon 2020-03-13 134 * @nor: pointer to 'struct spi_nor'.
7b8b22010af95f Boris Brezillon 2020-03-13 135 * @enable: true to enter the 4-byte address mode, false to exit the 4-byte
7b8b22010af95f Boris Brezillon 2020-03-13 136 * address mode.
7b8b22010af95f Boris Brezillon 2020-03-13 137 *
7b8b22010af95f Boris Brezillon 2020-03-13 138 * Return: 0 on success, -errno otherwise.
7b8b22010af95f Boris Brezillon 2020-03-13 139 */
c09cbfe090ed60 Michael Walle 2022-02-18 140 static int winbond_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
7b8b22010af95f Boris Brezillon 2020-03-13 @141 {
7b8b22010af95f Boris Brezillon 2020-03-13 142 int ret;
7b8b22010af95f Boris Brezillon 2020-03-13 143
7b8b22010af95f Boris Brezillon 2020-03-13 144 ret = spi_nor_set_4byte_addr_mode(nor, enable);
7b8b22010af95f Boris Brezillon 2020-03-13 145 if (ret || enable)
7b8b22010af95f Boris Brezillon 2020-03-13 146 return ret;
7b8b22010af95f Boris Brezillon 2020-03-13 147
7b8b22010af95f Boris Brezillon 2020-03-13 148 /*
7b8b22010af95f Boris Brezillon 2020-03-13 149 * On Winbond W25Q256FV, leaving 4byte mode causes the Extended Address
7b8b22010af95f Boris Brezillon 2020-03-13 150 * Register to be set to 1, so all 3-byte-address reads come from the
7b8b22010af95f Boris Brezillon 2020-03-13 151 * second 16M. We must clear the register to enable normal behavior.
7b8b22010af95f Boris Brezillon 2020-03-13 152 */
7b8b22010af95f Boris Brezillon 2020-03-13 153 ret = spi_nor_write_enable(nor);
7b8b22010af95f Boris Brezillon 2020-03-13 154 if (ret)
7b8b22010af95f Boris Brezillon 2020-03-13 155 return ret;
7b8b22010af95f Boris Brezillon 2020-03-13 156
7b8b22010af95f Boris Brezillon 2020-03-13 157 ret = spi_nor_write_ear(nor, 0);
7b8b22010af95f Boris Brezillon 2020-03-13 158 if (ret)
7b8b22010af95f Boris Brezillon 2020-03-13 159 return ret;
7b8b22010af95f Boris Brezillon 2020-03-13 160
7b8b22010af95f Boris Brezillon 2020-03-13 161 return spi_nor_write_disable(nor);
7b8b22010af95f Boris Brezillon 2020-03-13 162 }
7b8b22010af95f Boris Brezillon 2020-03-13 163
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]