1 /* Copyright 2000 AG Electronics Ltd. */
2 /* This code is distributed without warranty under the GPL v2 (see COPYING) */
5 #include <console/console.h>
9 static flash_device *first_flash = 0;
11 int register_flash_device (const flash_fn * fn, char *tag, void *data)
13 flash_device *device = malloc (sizeof (flash_device));
21 if ((result = fn->identify(device)) != 0)
23 printk_info("Registered flash %s\n", result);
24 device->next = first_flash;
27 return result ? 0 : -1;
32 flash_device *find_flash_device(const char *name)
34 int len = strlen(name);
40 for (flash = first_flash; flash; flash = flash->next)
41 if (strlen(flash->tag) == len && memcmp(name, flash->tag, len) == 0)
44 printk_info ("No flash %s registered\n", name);