Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/54043 )
Change subject: stlinkv3_spi.c: Drop stlinkv3_ prefix for spi data struct member ......................................................................
stlinkv3_spi.c: Drop stlinkv3_ prefix for spi data struct member
The name of the struct already contains stlinkv3_ prefix, so prefix doesn't need to be repeated in members name.
BUG=b:185191942 TEST=builds
Change-Id: Ibddac9371ab8f08276d499642a9bdd6dbecea0ca Signed-off-by: Anastasia Klimchuk aklm@chromium.org --- M stlinkv3_spi.c 1 file changed, 13 insertions(+), 13 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/43/54043/1
diff --git a/stlinkv3_spi.c b/stlinkv3_spi.c index f1e455b..1bb8525 100644 --- a/stlinkv3_spi.c +++ b/stlinkv3_spi.c @@ -121,7 +121,7 @@
struct stlinkv3_spi_data { struct libusb_context *usb_ctx; - libusb_device_handle *stlinkv3_handle; + libusb_device_handle *handle; };
static int stlinkv3_command(uint8_t *command, size_t command_length, @@ -355,7 +355,7 @@ uint32_t rw_status = 0; unsigned int i;
- if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_LOW, stlinkv3_data->stlinkv3_handle)) { + if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_LOW, stlinkv3_data->handle)) { msg_perr("Failed to set the NSS pin to low\n"); return -1; } @@ -370,7 +370,7 @@ for (i = 0; (i < 8) && (i < write_cnt); i++) command[4+i] = write_arr[i];
- rc = libusb_bulk_transfer(stlinkv3_data->stlinkv3_handle, STLINK_EP_OUT, + rc = libusb_bulk_transfer(stlinkv3_data->handle, STLINK_EP_OUT, command, sizeof(command), &actual_length, USB_TIMEOUT_IN_MS); if (rc != LIBUSB_TRANSFER_COMPLETED || actual_length != sizeof(command)) { @@ -380,7 +380,7 @@ }
if (write_cnt > 8) { - rc = libusb_bulk_transfer(stlinkv3_data->stlinkv3_handle, + rc = libusb_bulk_transfer(stlinkv3_data->handle, STLINK_EP_OUT, (unsigned char *)&write_arr[8], (unsigned int)(write_cnt - 8), @@ -393,7 +393,7 @@ } }
- if (stlinkv3_get_last_readwrite_status(&rw_status, stlinkv3_data->stlinkv3_handle)) + if (stlinkv3_get_last_readwrite_status(&rw_status, stlinkv3_data->handle)) return -1;
if (rw_status != 0) { @@ -406,7 +406,7 @@ command[2] = (uint8_t)read_cnt; command[3] = (uint8_t)(read_cnt >> 8);
- rc = libusb_bulk_transfer(stlinkv3_data->stlinkv3_handle, STLINK_EP_OUT, + rc = libusb_bulk_transfer(stlinkv3_data->handle, STLINK_EP_OUT, command, sizeof(command), &actual_length, USB_TIMEOUT_IN_MS); if (rc != LIBUSB_TRANSFER_COMPLETED || (unsigned int)actual_length != sizeof(command)) { @@ -415,7 +415,7 @@ goto transmit_err; }
- rc = libusb_bulk_transfer(stlinkv3_data->stlinkv3_handle, + rc = libusb_bulk_transfer(stlinkv3_data->handle, STLINK_EP_IN, (unsigned char *)read_arr, (int)read_cnt, @@ -428,7 +428,7 @@ } }
- if (stlinkv3_get_last_readwrite_status(&rw_status, stlinkv3_data->stlinkv3_handle)) + if (stlinkv3_get_last_readwrite_status(&rw_status, stlinkv3_data->handle)) goto transmit_err;
if (rw_status != 0) { @@ -436,14 +436,14 @@ goto transmit_err; }
- if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_HIGH, stlinkv3_data->stlinkv3_handle)) { + if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_HIGH, stlinkv3_data->handle)) { msg_perr("Failed to set the NSS pin to high\n"); return -1; } return 0;
transmit_err: - if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_HIGH, stlinkv3_data->stlinkv3_handle)) + if (stlinkv3_spi_set_SPI_NSS(SPI_NSS_HIGH, stlinkv3_data->handle)) msg_perr("Failed to set the NSS pin to high\n"); return -1; } @@ -463,9 +463,9 @@ stlinkv3_command(command, sizeof(command), answer, sizeof(answer), "STLINK_BRIDGE_CLOSE", - stlinkv3_data->stlinkv3_handle); + stlinkv3_data->handle);
- libusb_close(stlinkv3_data->stlinkv3_handle); + libusb_close(stlinkv3_data->handle); libusb_exit(stlinkv3_data->usb_ctx);
free(data); @@ -540,7 +540,7 @@ }
stlinkv3_data->usb_ctx = usb_ctx; - stlinkv3_data->stlinkv3_handle = stlinkv3_handle; + stlinkv3_data->handle = stlinkv3_handle; spi_programmer_stlinkv3.data = stlinkv3_data;
if (register_shutdown(stlinkv3_spi_shutdown, stlinkv3_data)) {