Attention is currently required from: Xiang Wang, Stefan Reinauer. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/49254 )
Change subject: sysfsgpio.c implement spi interface via linux sysfs ......................................................................
Patch Set 1:
(3 comments)
File Makefile:
https://review.coreboot.org/c/flashrom/+/49254/comment/c1706124_13507e25 PS1, Line 1: # Both meson.* and the Makefile needs modifying as well unfortunately.
File sysfsgpio.c:
https://review.coreboot.org/c/flashrom/+/49254/comment/4a0f453a_8490890b PS1, Line 38: #define EXIST_PATH(path) (access((path), F_OK) == 0 cute but just inline it, the indirection is not necessary.
https://review.coreboot.org/c/flashrom/+/49254/comment/a99344f5_029e7be1 PS1, Line 209: /* parameter format: pins=cs_pin:sck_pin:mosi_pin:miso_pin */ : char *pins = extract_programmer_param("pins"); : int pins_inited = 0; : do { : struct pin_desc *pins_tab[] = { : &pin_cs, &pin_sck, &pin_mosi, &pin_miso : }; : if (!(pins && strlen(pins))) : break; : char *token = strtok(pins, ":"); : for (unsigned i = 0; i < ARRAY_SIZE(pins_tab); i++) { : long v; : if (!token) : break; : if (atoi_s(token, 1, &v)) : break; : pins_tab[i]->pin = v; : if (export_sysfsgpio(pins_tab[i])) : break; : token = strtok(NULL, ":"); : pins_inited = (i + 1 == ARRAY_SIZE(pins_tab)); : } : } while (0); : if (pins) : free(pins); : if (!pins_inited) : return 1; I suggest making this its own static fn for param extraction and pass in &pin_desc to fetch out the result