OpenOCD
common.c File Reference
Include dependency graph for common.c:

Go to the source code of this file.

Functions

bool flash_driver_name_matches (const char *name, const char *expected)
 Attempt to match the expected name with the name of a driver. More...
 
unsigned get_flash_name_index (const char *name)
 Parses the optional '.index' portion of a flash bank identifier. More...
 

Function Documentation

◆ flash_driver_name_matches()

bool flash_driver_name_matches ( const char *  name,
const char *  expected 
)

Attempt to match the expected name with the name of a driver.

Parameters
nameThe name of the driver (from the bank's device structure).
expectedThe expected driver name, passed by the user.

Definition at line 27 of file common.c.

References name.

Referenced by get_flash_bank_by_name_noprobe(), and get_nand_device_by_name().

◆ get_flash_name_index()

unsigned get_flash_name_index ( const char *  name)

Parses the optional '.index' portion of a flash bank identifier.

Parameters
nameThe desired driver name, passed by the user.
Returns
The parsed index request, or 0 if not present. If the name provides a suffix but it does not parse as an unsigned integer, the routine returns ~0U. This will prevent further matching.

Definition at line 14 of file common.c.

References ERROR_OK, and name.

Referenced by get_flash_bank_by_name_noprobe(), and get_nand_device_by_name().