/* Add specified device to the global device list. */
static void device_add(struct mtd_device *dev)
/* Add specified device to the global device list. */
static void device_add(struct mtd_device *dev)
{
	u8 current_save_needed = 0;
	if (list_empty(&devices)) {
		current_mtd_dev = dev;
		current_mtd_partnum = 0;
		current_save_needed = 1;
	}
	list_add_tail(&dev->link, &devices);
	if (current_save_needed > 0)
		current_save();
	else
		index_partitions();
}