add flash/nor/drivers.c
Encapsulates access to the flash_drivers array, providing a base of operations for future dynamic driver module loading features.
This commit is contained in:
@@ -25,19 +25,8 @@
|
||||
#include <target/image.h>
|
||||
|
||||
// in flash.c, to be moved here
|
||||
extern struct flash_driver *flash_drivers[];
|
||||
extern struct flash_bank *flash_banks;
|
||||
|
||||
struct flash_driver *flash_driver_find_by_name(const char *name)
|
||||
{
|
||||
for (unsigned i = 0; flash_drivers[i]; i++)
|
||||
{
|
||||
if (strcmp(name, flash_drivers[i]->name) == 0)
|
||||
return flash_drivers[i];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int flash_driver_erase(struct flash_bank *bank, int first, int last)
|
||||
{
|
||||
int retval;
|
||||
|
||||
Reference in New Issue
Block a user