jtag/drivers/ftdi: Use correct command error
[openocd.git] / src / helper / jep106.c
blob62d24a9b23d1ea08bc73169cbadf450bf4d35c32
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 /***************************************************************************
4 * Copyright (C) 2015 Andreas Fritiofson *
5 * andreas.fritiofson@gmail.com *
6 ***************************************************************************/
8 #ifdef HAVE_CONFIG_H
9 #include "config.h"
10 #endif
12 #include "jep106.h"
13 #include "log.h"
15 static const char * const jep106[][126] = {
16 #include "jep106.inc"
19 const char *jep106_table_manufacturer(unsigned int bank, unsigned int id)
21 if (id < 1 || id > 126) {
22 LOG_DEBUG("BUG: Caller passed out-of-range JEP106 ID!");
23 return "<invalid>";
26 /* index is zero based */
27 id--;
29 if (bank >= ARRAY_SIZE(jep106) || !jep106[bank][id])
30 return "<unknown>";
32 return jep106[bank][id];