1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

tree/: Drop default_spi_probe_opcode for NULL case

A NULL func pointer is necessary and sufficient for the
condition `NULL func pointer => true' as to not need this
boilerplate as it implies default behaviour of a supported
opcode within the `check_block_eraser()` match supported loop.

Ran;
```
$  find . -name '*.[c,h]' -exec sed -i '/.probe_opcode	= default_spi_probe_opcode,/d' '{}' \;
```

Change-Id: Id502c5d2596ad1db52faf05723083620e4c52c12
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/70264
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
This commit is contained in:
Edward O'Callaghan
2022-12-20 12:33:13 +11:00
committed by Thomas Heijligen
parent c66d2bd1ca
commit e1f30bbce7
29 changed files with 10 additions and 35 deletions

View File

@ -132,7 +132,7 @@ int spi_write_register(const struct flashctx *flash, enum flash_reg reg, uint8_t
return 1;
}
if (!flash->mst->spi.probe_opcode(flash, write_cmd[0])) {
if (!spi_probe_opcode(flash, write_cmd[0])) {
msg_pdbg("%s: write to register %d not supported by programmer, ignoring.\n", __func__, reg);
return SPI_INVALID_OPCODE;
}
@ -246,7 +246,7 @@ int spi_read_register(const struct flashctx *flash, enum flash_reg reg, uint8_t
return 1;
}
if (!flash->mst->spi.probe_opcode(flash, read_cmd)) {
if (!spi_probe_opcode(flash, read_cmd)) {
msg_pdbg("%s: read from register %d not supported by programmer.\n", __func__, reg);
return SPI_INVALID_OPCODE;
}