Attention is currently required from: Peter Marheine. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/51967 )
Change subject: lspcon_i2c_spi: support a devpath option ......................................................................
Patch Set 2: Code-Review+1
(5 comments)
File lspcon_i2c_spi.c:
https://review.coreboot.org/c/flashrom/+/51967/comment/c7b42129_979dcfe0 PS1, Line 486: msg_perr("%s: one of devpath or bus must be specified\n", __func__);
Revised further so invalid bus values are distinct from unspecified, allowing the two options to be […]
Looks pretty good, thanks!
File lspcon_i2c_spi.c:
https://review.coreboot.org/c/flashrom/+/51967/comment/1d761af6_038e166e PS2, Line 457: __func__); nit: `__func__` probably fits on the previous line
https://review.coreboot.org/c/flashrom/+/51967/comment/1ed569e8_6344b581 PS2, Line 463: __func__); nit: `__func__` most likely fits on the previous line
https://review.coreboot.org/c/flashrom/+/51967/comment/595e213a_008dcb85 PS2, Line 489: nit: replace 8 spaces with a tab
https://review.coreboot.org/c/flashrom/+/51967/comment/9d92aef5_92a9d149 PS2, Line 492: } else if (device_path != NULL) { The first two cases are error paths that return an error, whereas the last two cases are the "normal" paths. I wouldn't use `else` with the former, in order to differentiate both kinds of paths:
if (device_path != NULL && bus_number >= 0) { msg_perr("%s: only one of bus and devpath may be specified\n", __func__); free(device_path); return SPI_GENERIC_ERROR; } if (device_path == NULL && bus_number < 0) { msg_perr("%s: one of bus and devpath must be specified\n", __func__); return SPI_GENERIC_ERROR; } if (device_path != NULL) { fd = i2c_open_path(device_path, REGISTER_ADDRESS, 0); free(device_path); } else { fd = i2c_open(bus_number, REGISTER_ADDRESS, 0); }