16 const char *name_index = strrchr(
name,
'.');
19 if (name_index[1] <
'0' || name_index[1] >
'9')
21 unsigned int requested;
22 int retval = parse_uint(name_index + 1, &requested);
24 return (retval ==
ERROR_OK) ? requested : ~0U;
29 unsigned int blen = strlen(
name);
31 if (strncmp(
name, expected, blen) != 0)
35 return expected[blen] ==
'.' || expected[blen] ==
'\0';
bool flash_driver_name_matches(const char *name, const char *expected)
Attempt to match the expected name with the name of a driver.
unsigned int get_flash_name_index(const char *name)
Parses the optional '.index' portion of a flash bank identifier.