diff mbox series

[v2,41/41] mtd: spi-nor: core: get rid of the INFOx() macros

Message ID 20230807-mtd-flash-info-db-rework-v2-41-291a0f39f8d8@kernel.org
State Changes Requested
Delegated to: Ambarus Tudor
Headers show
Series mtd: spi-nor: clean the flash_info database up | expand

Commit Message

Michael Walle Aug. 22, 2023, 7:09 a.m. UTC
Now that all flash_info tables are converted to the new format, remove
the old INFOx() macros.

Signed-off-by: Michael Walle <mwalle@kernel.org>
---
 drivers/mtd/spi-nor/core.h | 65 ----------------------------------------------
 1 file changed, 65 deletions(-)

Comments

Tudor Ambarus Sept. 6, 2023, 7:40 a.m. UTC | #1
On 22.08.2023 10:09, Michael Walle wrote:
> Now that all flash_info tables are converted to the new format, remove
> the old INFOx() macros.
> 
> Signed-off-by: Michael Walle <mwalle@kernel.org>


Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>

> ---
>  drivers/mtd/spi-nor/core.h | 65 ----------------------------------------------
>  1 file changed, 65 deletions(-)
> 
> diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
> index 420e5ca2cfe1..1febb4a3c59b 100644
> --- a/drivers/mtd/spi-nor/core.h
> +++ b/drivers/mtd/spi-nor/core.h
> @@ -573,71 +573,6 @@ struct flash_info {
>  		.n_regions = (_n_regions),				\
>  	})
>  
> -#define SPI_NOR_ID_2ITEMS(_id) ((_id) >> 8) & 0xff, (_id) & 0xff
> -#define SPI_NOR_ID_3ITEMS(_id) ((_id) >> 16) & 0xff, SPI_NOR_ID_2ITEMS(_id)
> -
> -#define SPI_NOR_ID(_jedec_id, _ext_id)					\
> -	.id = &(const struct spi_nor_id){				\
> -		.bytes = (const u8[]){ SPI_NOR_ID_3ITEMS(_jedec_id),	\
> -				       SPI_NOR_ID_2ITEMS(_ext_id) },	\
> -		.len = !(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0)),	\
> -	}
> -
> -#define SPI_NOR_ID6(_jedec_id, _ext_id)					\
> -	.id = &(const struct spi_nor_id){				\
> -		.bytes = (const u8[]){ SPI_NOR_ID_3ITEMS(_jedec_id),	\
> -				       SPI_NOR_ID_3ITEMS(_ext_id) },	\
> -		.len = 6,						\
> -	}
> -
> -#define SPI_NOR_GEOMETRY(_sector_size, _n_sectors, _n_banks)		\
> -	.size = (_sector_size) * (_n_sectors),				\
> -	.sector_size = (_sector_size == SZ_64K) ? 0 : (_sector_size),	\
> -	.n_banks = (_n_banks)
> -
> -/* Used when the "_ext_id" is two bytes at most */
> -#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)		\
> -	SPI_NOR_ID((_jedec_id), (_ext_id)),				\
> -	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
> -
> -#define INFO0(_sector_size, _n_sectors)					\
> -	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
> -
> -#define INFOB(_jedec_id, _ext_id, _sector_size, _n_sectors, _n_banks)	\
> -	SPI_NOR_ID((_jedec_id), (_ext_id)),				\
> -	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), (_n_banks)),
> -
> -#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors)		\
> -	SPI_NOR_ID6((_jedec_id), (_ext_id)),				\
> -	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
> -
> -#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_nbytes)	\
> -		.size = (_sector_size) * (_n_sectors),			\
> -		.sector_size = (_sector_size),				\
> -		.page_size = (_page_size),				\
> -		.addr_nbytes = (_addr_nbytes),				\
> -		.flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,		\
> -
> -#define OTP_INFO(_len, _n_regions, _base, _offset)			\
> -		.otp = &(const struct spi_nor_otp_organization){	\
> -			.len = (_len),					\
> -			.base = (_base),				\
> -			.offset = (_offset),				\
> -			.n_regions = (_n_regions),			\
> -		},
> -
> -#define FLAGS(_flags)							\
> -		.flags = (_flags),					\
> -
> -#define NO_SFDP_FLAGS(_no_sfdp_flags)					\
> -		.no_sfdp_flags = (_no_sfdp_flags),			\
> -
> -#define FIXUP_FLAGS(_fixup_flags)					\
> -		.fixup_flags = (_fixup_flags),				\
> -
> -#define MFR_FLAGS(_mfr_flags)						\
> -		.mfr_flags = (_mfr_flags),				\
> -
>  /**
>   * struct spi_nor_manufacturer - SPI NOR manufacturer object
>   * @name: manufacturer name
>
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index 420e5ca2cfe1..1febb4a3c59b 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -573,71 +573,6 @@  struct flash_info {
 		.n_regions = (_n_regions),				\
 	})
 
-#define SPI_NOR_ID_2ITEMS(_id) ((_id) >> 8) & 0xff, (_id) & 0xff
-#define SPI_NOR_ID_3ITEMS(_id) ((_id) >> 16) & 0xff, SPI_NOR_ID_2ITEMS(_id)
-
-#define SPI_NOR_ID(_jedec_id, _ext_id)					\
-	.id = &(const struct spi_nor_id){				\
-		.bytes = (const u8[]){ SPI_NOR_ID_3ITEMS(_jedec_id),	\
-				       SPI_NOR_ID_2ITEMS(_ext_id) },	\
-		.len = !(_jedec_id) ? 0 : (3 + ((_ext_id) ? 2 : 0)),	\
-	}
-
-#define SPI_NOR_ID6(_jedec_id, _ext_id)					\
-	.id = &(const struct spi_nor_id){				\
-		.bytes = (const u8[]){ SPI_NOR_ID_3ITEMS(_jedec_id),	\
-				       SPI_NOR_ID_3ITEMS(_ext_id) },	\
-		.len = 6,						\
-	}
-
-#define SPI_NOR_GEOMETRY(_sector_size, _n_sectors, _n_banks)		\
-	.size = (_sector_size) * (_n_sectors),				\
-	.sector_size = (_sector_size == SZ_64K) ? 0 : (_sector_size),	\
-	.n_banks = (_n_banks)
-
-/* Used when the "_ext_id" is two bytes at most */
-#define INFO(_jedec_id, _ext_id, _sector_size, _n_sectors)		\
-	SPI_NOR_ID((_jedec_id), (_ext_id)),				\
-	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
-
-#define INFO0(_sector_size, _n_sectors)					\
-	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
-
-#define INFOB(_jedec_id, _ext_id, _sector_size, _n_sectors, _n_banks)	\
-	SPI_NOR_ID((_jedec_id), (_ext_id)),				\
-	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), (_n_banks)),
-
-#define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors)		\
-	SPI_NOR_ID6((_jedec_id), (_ext_id)),				\
-	SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 0),
-
-#define CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_nbytes)	\
-		.size = (_sector_size) * (_n_sectors),			\
-		.sector_size = (_sector_size),				\
-		.page_size = (_page_size),				\
-		.addr_nbytes = (_addr_nbytes),				\
-		.flags = SPI_NOR_NO_ERASE | SPI_NOR_NO_FR,		\
-
-#define OTP_INFO(_len, _n_regions, _base, _offset)			\
-		.otp = &(const struct spi_nor_otp_organization){	\
-			.len = (_len),					\
-			.base = (_base),				\
-			.offset = (_offset),				\
-			.n_regions = (_n_regions),			\
-		},
-
-#define FLAGS(_flags)							\
-		.flags = (_flags),					\
-
-#define NO_SFDP_FLAGS(_no_sfdp_flags)					\
-		.no_sfdp_flags = (_no_sfdp_flags),			\
-
-#define FIXUP_FLAGS(_fixup_flags)					\
-		.fixup_flags = (_fixup_flags),				\
-
-#define MFR_FLAGS(_mfr_flags)						\
-		.mfr_flags = (_mfr_flags),				\
-
 /**
  * struct spi_nor_manufacturer - SPI NOR manufacturer object
  * @name: manufacturer name