Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e99e90ae authored by Ben Hutchings's avatar Ben Hutchings Committed by David Woodhouse
Browse files

mtd: nandsim: Define CONFIG_NANDSIM_MAX_PARTS and use it instead of MAX_MTD_DEVICES



MAX_MTD_DEVICES is about to be removed.

Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 677c2aec
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -80,6 +80,9 @@
#ifndef CONFIG_NANDSIM_DBG
#ifndef CONFIG_NANDSIM_DBG
#define CONFIG_NANDSIM_DBG        0
#define CONFIG_NANDSIM_DBG        0
#endif
#endif
#ifndef CONFIG_NANDSIM_MAX_PARTS
#define CONFIG_NANDSIM_MAX_PARTS  32
#endif


static uint first_id_byte  = CONFIG_NANDSIM_FIRST_ID_BYTE;
static uint first_id_byte  = CONFIG_NANDSIM_FIRST_ID_BYTE;
static uint second_id_byte = CONFIG_NANDSIM_SECOND_ID_BYTE;
static uint second_id_byte = CONFIG_NANDSIM_SECOND_ID_BYTE;
@@ -94,7 +97,7 @@ static uint bus_width = CONFIG_NANDSIM_BUS_WIDTH;
static uint do_delays      = CONFIG_NANDSIM_DO_DELAYS;
static uint do_delays      = CONFIG_NANDSIM_DO_DELAYS;
static uint log            = CONFIG_NANDSIM_LOG;
static uint log            = CONFIG_NANDSIM_LOG;
static uint dbg            = CONFIG_NANDSIM_DBG;
static uint dbg            = CONFIG_NANDSIM_DBG;
static unsigned long parts[MAX_MTD_DEVICES];
static unsigned long parts[CONFIG_NANDSIM_MAX_PARTS];
static unsigned int parts_num;
static unsigned int parts_num;
static char *badblocks = NULL;
static char *badblocks = NULL;
static char *weakblocks = NULL;
static char *weakblocks = NULL;
@@ -288,7 +291,7 @@ union ns_mem {
 * The structure which describes all the internal simulator data.
 * The structure which describes all the internal simulator data.
 */
 */
struct nandsim {
struct nandsim {
	struct mtd_partition partitions[MAX_MTD_DEVICES];
	struct mtd_partition partitions[CONFIG_NANDSIM_MAX_PARTS];
	unsigned int nbparts;
	unsigned int nbparts;


	uint busw;              /* flash chip bus width (8 or 16) */
	uint busw;              /* flash chip bus width (8 or 16) */