mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
Convert all messages in bitbang_spi.c to the new message infrastructure
Corresponding to flashrom svn r852. Signed-off-by: Sean Nelson <audiohacked@gmail.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
This commit is contained in:
parent
84f7bce91b
commit
676a232f43
@ -99,14 +99,14 @@ int bitbang_spi_send_command(unsigned int writecnt, unsigned int readcnt,
|
|||||||
if (bufsize > oldbufsize) {
|
if (bufsize > oldbufsize) {
|
||||||
bufout = realloc(bufout, bufsize);
|
bufout = realloc(bufout, bufsize);
|
||||||
if (!bufout) {
|
if (!bufout) {
|
||||||
fprintf(stderr, "Out of memory!\n");
|
msg_perr("Out of memory!\n");
|
||||||
if (bufin)
|
if (bufin)
|
||||||
free(bufin);
|
free(bufin);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
bufin = realloc(bufout, bufsize);
|
bufin = realloc(bufout, bufsize);
|
||||||
if (!bufin) {
|
if (!bufin) {
|
||||||
fprintf(stderr, "Out of memory!\n");
|
msg_perr("Out of memory!\n");
|
||||||
if (bufout)
|
if (bufout)
|
||||||
free(bufout);
|
free(bufout);
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -143,7 +143,7 @@ int bitbang_spi_write_256(struct flashchip *flash, uint8_t *buf)
|
|||||||
int total_size = 1024 * flash->total_size;
|
int total_size = 1024 * flash->total_size;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
printf_debug("total_size is %d\n", total_size);
|
msg_pdbg("total_size is %d\n", total_size);
|
||||||
for (i = 0; i < total_size; i += 256) {
|
for (i = 0; i < total_size; i += 256) {
|
||||||
int l, r;
|
int l, r;
|
||||||
if (i + 256 <= total_size)
|
if (i + 256 <= total_size)
|
||||||
@ -152,7 +152,7 @@ int bitbang_spi_write_256(struct flashchip *flash, uint8_t *buf)
|
|||||||
l = total_size - i;
|
l = total_size - i;
|
||||||
|
|
||||||
if ((r = spi_nbyte_program(i, &buf[i], l))) {
|
if ((r = spi_nbyte_program(i, &buf[i], l))) {
|
||||||
fprintf(stderr, "%s: write fail %d\n", __func__, r);
|
msg_perr("%s: write fail %d\n", __func__, r);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user