mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +02:00
raiden_debug_spi.c: Fix indents to be consistent
Change-Id: I414d6e5fcb590a006dd53fa93df80ec2a765c5d1 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/39308 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
parent
a43e44b6ab
commit
4847496062
@ -151,12 +151,12 @@ static int send_command(struct flashctx *flash,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (write_count > MAX_PACKET_SIZE - PACKET_HEADER_SIZE) {
|
if (write_count > MAX_PACKET_SIZE - PACKET_HEADER_SIZE) {
|
||||||
msg_perr("Raiden: invalid write_count of %d\n", write_count);
|
msg_perr("Raiden: Invalid write_count of %d\n", write_count);
|
||||||
return SPI_INVALID_LENGTH;
|
return SPI_INVALID_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_count > MAX_PACKET_SIZE - PACKET_HEADER_SIZE) {
|
if (read_count > MAX_PACKET_SIZE - PACKET_HEADER_SIZE) {
|
||||||
msg_perr("Raiden: invalid read_count of %d\n", read_count);
|
msg_perr("Raiden: Invalid read_count of %d\n", read_count);
|
||||||
return SPI_INVALID_LENGTH;
|
return SPI_INVALID_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,11 +166,11 @@ static int send_command(struct flashctx *flash,
|
|||||||
memcpy(buffer + PACKET_HEADER_SIZE, write_buffer, write_count);
|
memcpy(buffer + PACKET_HEADER_SIZE, write_buffer, write_count);
|
||||||
|
|
||||||
ret = LIBUSB(libusb_bulk_transfer(device->handle,
|
ret = LIBUSB(libusb_bulk_transfer(device->handle,
|
||||||
out_endpoint,
|
out_endpoint,
|
||||||
buffer,
|
buffer,
|
||||||
write_count + PACKET_HEADER_SIZE,
|
write_count + PACKET_HEADER_SIZE,
|
||||||
&transferred,
|
&transferred,
|
||||||
TRANSFER_TIMEOUT_MS));
|
TRANSFER_TIMEOUT_MS));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: OUT transfer failed\n"
|
msg_perr("Raiden: OUT transfer failed\n"
|
||||||
" write_count = %d\n"
|
" write_count = %d\n"
|
||||||
@ -186,11 +186,11 @@ static int send_command(struct flashctx *flash,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = LIBUSB(libusb_bulk_transfer(device->handle,
|
ret = LIBUSB(libusb_bulk_transfer(device->handle,
|
||||||
in_endpoint,
|
in_endpoint,
|
||||||
buffer,
|
buffer,
|
||||||
read_count + PACKET_HEADER_SIZE,
|
read_count + PACKET_HEADER_SIZE,
|
||||||
&transferred,
|
&transferred,
|
||||||
TRANSFER_TIMEOUT_MS));
|
TRANSFER_TIMEOUT_MS));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: IN transfer failed\n"
|
msg_perr("Raiden: IN transfer failed\n"
|
||||||
" write_count = %d\n"
|
" write_count = %d\n"
|
||||||
@ -201,7 +201,7 @@ static int send_command(struct flashctx *flash,
|
|||||||
|
|
||||||
if ((unsigned) transferred != read_count + PACKET_HEADER_SIZE) {
|
if ((unsigned) transferred != read_count + PACKET_HEADER_SIZE) {
|
||||||
msg_perr("Raiden: Read failure (read %d, expected %d)\n",
|
msg_perr("Raiden: Read failure (read %d, expected %d)\n",
|
||||||
transferred, read_count + PACKET_HEADER_SIZE);
|
transferred, read_count + PACKET_HEADER_SIZE);
|
||||||
return 0x10002;
|
return 0x10002;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,16 +281,16 @@ static int find_endpoints(struct usb_device *dev, uint8_t *in_ep, uint8_t *out_e
|
|||||||
static int shutdown(void * data)
|
static int shutdown(void * data)
|
||||||
{
|
{
|
||||||
int ret = LIBUSB(libusb_control_transfer(
|
int ret = LIBUSB(libusb_control_transfer(
|
||||||
device->handle,
|
device->handle,
|
||||||
LIBUSB_ENDPOINT_OUT |
|
LIBUSB_ENDPOINT_OUT |
|
||||||
LIBUSB_REQUEST_TYPE_VENDOR |
|
LIBUSB_REQUEST_TYPE_VENDOR |
|
||||||
LIBUSB_RECIPIENT_INTERFACE,
|
LIBUSB_RECIPIENT_INTERFACE,
|
||||||
RAIDEN_DEBUG_SPI_REQ_DISABLE,
|
RAIDEN_DEBUG_SPI_REQ_DISABLE,
|
||||||
0,
|
0,
|
||||||
device->interface_descriptor->bInterfaceNumber,
|
device->interface_descriptor->bInterfaceNumber,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
TRANSFER_TIMEOUT_MS));
|
TRANSFER_TIMEOUT_MS));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: Failed to disable SPI bridge\n");
|
msg_perr("Raiden: Failed to disable SPI bridge\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -368,15 +368,15 @@ int raiden_debug_spi_init(void)
|
|||||||
device = current;
|
device = current;
|
||||||
|
|
||||||
if (find_endpoints(device, &in_endpoint, &out_endpoint)) {
|
if (find_endpoints(device, &in_endpoint, &out_endpoint)) {
|
||||||
msg_pdbg("Raiden: Failed to find valid endpoints on device");
|
msg_pdbg("Raiden: Failed to find valid endpoints on device");
|
||||||
usb_device_show(" ", current);
|
usb_device_show(" ", current);
|
||||||
goto loop_end;
|
goto loop_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usb_device_claim(device)) {
|
if (usb_device_claim(device)) {
|
||||||
msg_pdbg("Raiden: Failed to claim USB device");
|
msg_pdbg("Raiden: Failed to claim USB device");
|
||||||
usb_device_show(" ", current);
|
usb_device_show(" ", current);
|
||||||
goto loop_end;
|
goto loop_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!serial) {
|
if (!serial) {
|
||||||
@ -395,9 +395,9 @@ int raiden_debug_spi_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = libusb_get_string_descriptor_ascii(device->handle,
|
rc = libusb_get_string_descriptor_ascii(device->handle,
|
||||||
descriptor.iSerialNumber,
|
descriptor.iSerialNumber,
|
||||||
dev_serial,
|
dev_serial,
|
||||||
sizeof(dev_serial));
|
sizeof(dev_serial));
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
LIBUSB(rc);
|
LIBUSB(rc);
|
||||||
} else {
|
} else {
|
||||||
@ -427,16 +427,16 @@ loop_end:
|
|||||||
free_dev_list(¤t);
|
free_dev_list(¤t);
|
||||||
|
|
||||||
ret = LIBUSB(libusb_control_transfer(
|
ret = LIBUSB(libusb_control_transfer(
|
||||||
device->handle,
|
device->handle,
|
||||||
LIBUSB_ENDPOINT_OUT |
|
LIBUSB_ENDPOINT_OUT |
|
||||||
LIBUSB_REQUEST_TYPE_VENDOR |
|
LIBUSB_REQUEST_TYPE_VENDOR |
|
||||||
LIBUSB_RECIPIENT_INTERFACE,
|
LIBUSB_RECIPIENT_INTERFACE,
|
||||||
request_enable,
|
request_enable,
|
||||||
0,
|
0,
|
||||||
device->interface_descriptor->bInterfaceNumber,
|
device->interface_descriptor->bInterfaceNumber,
|
||||||
NULL,
|
NULL,
|
||||||
0,
|
0,
|
||||||
TRANSFER_TIMEOUT_MS));
|
TRANSFER_TIMEOUT_MS));
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
msg_perr("Raiden: Failed to enable SPI bridge\n");
|
msg_perr("Raiden: Failed to enable SPI bridge\n");
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user