/* Search global device list and return pointer to the device of type and num specified. */
struct mtd_device* device_find(u8 type, u8 num)
/* Search global device list and return pointer to the device of type and num specified. */
struct mtd_device* device_find(u8 type, u8 num)
{
	struct list_head *entry;
	struct mtd_device *dev_tmp;
	list_for_each(entry, &devices) {
		dev_tmp = list_entry(entry, struct mtd_device, link);
		if ((dev_tmp->id->type == type) && (dev_tmp->id->num == num))
			return dev_tmp;
	}
	return NULL;
}